pkg/internal: copy cue builtin code to separate package
Mostly a copy and reorg. Contain minor modifications
to make it compile.
Adds Register function to facilitate registring.
Change-Id: I1494f9f057130277e82cb62d04973488de916473
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6884
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>