Browserify compatibility

In a browserify package, `this` will refer to a node-style
exports object, not window. So just reference `window`
directly. Mimicks a change in Leaflet itself.
Merge pull request #89 from nathanadams/master

Browserify compatibility