version that works with Google Closure Compiler

Closure Compiler in advanced mode needs a special syntax for global objects and goog.provide/require annotations. As far as I could test it, the submitted version works nicely.