Support node-webkit

In node-webkit, both window and exports exist, but exports should be used instead of window.