Code cleanup
Fix polyglot for firefox 30.0a1 (2014-02-17).

Apparently the WebIDL spec calls for `addEventListener` &c. to sit on
the global object.  I have not verified, but it doesn't make a
difference: we can just as easily extend `window` as `Window.prototype`
and this will work with the current (and future) Firefox behaviour.

However, IE8 doesn't let us modify `window.attachEvent` so we need a
hack for that use case.

Fix #18.
Merge pull request #19 from tildeio/fix-firefox-nightly

Fix polyglot for firefox 30.0a1 (2014-02-17).
Make jshint happy