add support for node-webkit

Browsers will always have `window` and possibly `global` with node-webkit.
Node will never have `window` but always have `global`.
Merge pull request #211 from stevenvachon/patch-1

add support for environments with both window and global