Removing explicit window references. Adding a global module.

The global module is simply a reference to the global scope.