Reorganize the construction of ScalaJS in scalajsenv.js.

Instead of building one big literal object, we add properties
one at a time. This doesn't make a difference to Closure, but
now we can define later fields in terms of earlier fields.
In toolsJS test, do not inherit __ScalaJSEnv.

Otherwise, multiple ScalaJS objects will share their env
field, each will try to set things in it and freeze it,
which is no good.
Make the environment info a global field directly.

Also, set its field `exportsNamespace` after the fact with
what we chose to use.

Finally, we also freeze the environment info object when we're
done with initializing Scala.js, to prevent anyone from modifying
it after that.
Fix #1184: Incorporate JSGlobal as a field of environment info.

This gets rid of an IR node and a compiler primitive.

Desugaring still applies a shortcut to simplify
ScalaJS.env["global"]
as
ScalaJS.g
which is quite important, given how much this field is used.
Merge pull request #1187 from sjrd/global-in-envinfo

Fix #1184: Incorporate JSGlobal as a field of environment info.