Remove predeclared names from the module globals dict (#86)

* Remove predeclared names from the module globals dict

Previously, the Skylark spec and Go implementation had a notion
of "predeclared globals", which are module globals that have a value
before execution begins, such as the 'glob' function in
the Bazel build language.  This is undesirable because it causes
every module to appear to define 'glob', and it makes this name
accessible to other modules through the load statement.

This CL changes the spec and implementation to match the Bazel behavior:
predeclared names like glob are no longer part of the module's globals dictionary,
but are treated similar to universal names such as None and len.
From the Skylark program's perspective, there is no difference
between per-module predeclared names and universal
predeclared names, and the spec now uses only the term "predeclared".
However, the resolver distinguishes them as an optimization as this allows
the evaluator to use separate dictionaries to represent the
universal and the per-module portions.

API CHANGE: The ExecFile function has changed, and so must all its callers.
Previously, it accepted the globals dictionary as a parameter,
populated with predeclared names, and execution would add more
names to this dictionary.  Now, it accepts the predeclared
dictionary (which it does not modify), and returns the globals
dictionary.

Also: the resolver now assigns an index to each global,
allowing the evaluator to use a flat representation for
globals similar to that for locals.

Fixes #75

(See also Google internal issue b/74460309)
diff --git a/example_test.go b/example_test.go
index 1be9a6d..8fa5f60 100644
--- a/example_test.go
+++ b/example_test.go
@@ -28,10 +28,11 @@
 	thread := &skylark.Thread{
 		Print: func(_ *skylark.Thread, msg string) { fmt.Println(msg) },
 	}
-	globals := skylark.StringDict{
+	predeclared := skylark.StringDict{
 		"greeting": skylark.String("hello"),
 	}
-	if err := skylark.ExecFile(thread, "apparent/filename.sky", data, globals); err != nil {
+	globals, err := skylark.ExecFile(thread, "apparent/filename.sky", data, predeclared)
+	if err != nil {
 		if evalErr, ok := err.(*skylark.EvalError); ok {
 			log.Fatal(evalErr.Backtrace())
 		}
@@ -54,7 +55,6 @@
 	// hello, world
 	//
 	// Globals:
-	// greeting (string) = "hello"
 	// squares (list) = [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
 }
 
@@ -89,8 +89,7 @@
 			// Load and initialize the module in a new thread.
 			data := fakeFilesystem[module]
 			thread := &skylark.Thread{Load: load}
-			globals := make(skylark.StringDict)
-			err := skylark.ExecFile(thread, module, data, globals)
+			globals, err := skylark.ExecFile(thread, module, data, nil)
 			e = &entry{globals, err}
 
 			// Update the cache.
@@ -243,12 +242,7 @@
 		},
 	}
 	data := c.fakeFilesystem[module]
-	globals := make(skylark.StringDict)
-	err := skylark.ExecFile(thread, module, data, globals)
-	if err != nil {
-		return nil, err
-	}
-	return globals, nil
+	return skylark.ExecFile(thread, module, data, nil)
 }
 
 // -- concurrent cycle checking --