Support node-webkit

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