Replaced top-level this expressions with window
Merge pull request #4971 from rnijveld/master

Replace top-level this keywords with window for usage with CommonJS and Browserify