Support for enviroment with `global` and `window`

Node-webkit has a global `global` object, while the global `this` is the
`window` object. Overwriting `global` with `window` breaks a lot of
things.