Browserify + node-webkit compatiblity

In browserify environment, jQuery is not available in the context of the
module. It need to be required. In node-webkit environment, the context
(or global in the closure) is an empty object. To get the expected
window object, global.window is provided.