cue/literal: implement CUE-specific quoting

Using strconv.Quote is incorrect, as CUE strings are not
entirely the same, resulting in bugs

Code and test cases have been copied from strconv.Quote
and is not based on the deleted (similar) implementation
of internal/core/export/quote.go.
Tests have been augmented with CUE-specific cases.

Note that because of the more complex string syntax of CUE,
the API is somewhat tricky. This API is hopefully straigtforward
given the number of options that need to be covered (not all
implemented).

Also fixes:
- variable indentation
- using tabs instead of spaces for indentation
- fixes multiline interpolation export bug

Fixes #122
Fixes #514
Fixes #540
Fixes #541

Change-Id: If79954678acbd6c9ded2da564856ac28018ba8e1
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7282
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/internal/core/adt/feature.go b/internal/core/adt/feature.go
index 74926a6..6ee3b6a 100644
--- a/internal/core/adt/feature.go
+++ b/internal/core/adt/feature.go
@@ -20,6 +20,7 @@
 
 	"cuelang.org/go/cue/ast"
 	"cuelang.org/go/cue/errors"
+	"cuelang.org/go/cue/literal"
 	"cuelang.org/go/cue/token"
 	"cuelang.org/go/internal"
 )
@@ -65,7 +66,7 @@
 		if ast.IsValidIdent(s) && !internal.IsDefOrHidden(s) {
 			return s
 		}
-		return strconv.Quote(s)
+		return literal.String.Quote(s)
 	default:
 		return index.IndexToString(int64(x))
 	}