Fixes browserify support

`root` variable is determined based on existence of `exports` and alternatively defaults to `this` which when used with `<script/>` is `window`... However if the module is packaged with any tool like browserify, `this` context ends up being some king of `define` function used to package files instead of `window`.

It feels that `root` should always be `window`. Also, I would like to optimize some variable references like `root.document` which don't get minified right now.

Thoughts?