Don't use window to access global object

In order to support contexts that don't use modules but aren't the browser.
Merge pull request #20 from Connorhd/patch-1

remove window usage (for execjs+v8)