Make script loader Web Worker friendly

Since `window` is not accessible in a Web Worker context, code like:
`require("script!myModule.js”);` will not work.

This is a fix.

A (maybe) better solution would be to have `webworker-script-loader` 
but I don't have an opinion on that.