Make support for node-webkit

Node-webkit exposes a global variable 'window', but the content of window (localStorage, location) is not available globally. They are still available through the window object as they would be on any browser, so this should only allow support for node-webkit and not break anything.