In node and browserify, the top-level `this` is the current module, i.e. `module.exports` and is `{}` until anything is exported. So in this case it looks for document on the current module. Obviously this won't work in node with since it uses window but most other commonjs bundlers implement things this way (I think). [Here's a thread](https://github.com/substack/browser-pack/issues/25) with a bunch of node/browserify folks clearing it up.