support environments with both window and global

Such environments include [node-webkit](https://github.com/rogerwang/node-webkit) and [atom-shell](https://github.com/atom/atom-shell).

This clears #1340 

---

~~This breaks the following tests within test/unit/node/generated-code-dependencies.js:~~
* ~~`test('class'`~~
* ~~`test('generator'`~~
* ~~`test('generator (symbols)'`~~
* ~~`test('compiled modules'`~~
* ~~`test('compiled modules inline'`~~
* ~~`test('compiled modules mix inline & script'`~~

~~I have not yet investigated the `child_process.exec()` based tests, however the `vm.runInNewContext()` tests have an issue with `global` within indirect `eval()`s. It gets pretty deep and difficult to debug. I am still working on this, but any help would be appreciated.~~
OK. I think you have convinced me that this mess is unavoidable.

I do have a cleanup suggestion though. How about we only pass in `this` to the runtime IIFE, and then we provide a runtime function called `getGlobal(thisObject)`. Then we can get rid of the nested ?: and we can provide comments explaining the different cases.