Global scope is not always window.

Fixed the issue when using a module in a web worker.

There the `global` object is not `window` but `self`.

See https://github.com/thlorenz/browserify-shim/issues/53
For a discussion.