add Worker support

Sorry about my editor trimming all the white-space, if it's annoying I can recreate the pull request. Essentially all this does is alias the "window" to the current global scope, allowing the use of the library from within web workers.