Browserify compatibility

Similar to https://github.com/Leaflet/Leaflet/pull/1572. "In a browserify package, `this` will refer to a node-style exports object, not window. So just reference `window` directly."