Support Browserify

- avoid references to 'this' as the global object, as browserify makes
  this undefined instead of the global
- also removing unchecked references to 'window'

See: https://github.com/substack/node-browserify/issues/372