Use window global variable instead of this.

Fixes issue with browserify.