Patch for window reference in Browserify

In Browserify the calling context of the module is an empty object. The reference to `window` is passed in as `global`. Since `global` and `this` are equivalent in Node it seems fine to use `global` when available.
- adds `global` to externs
- assigns `global` to `root` when present