Browserify compatibility

Replace 

`(function( w, doc ) { ... })( this, this.document );`
with
`(function( w, doc ) { ... })( window, window.document );`

see substack/node-browserify#372