Fixed CustomEvent

The `CustomEvent` constructor lives on `window` and not on `document`.
Merge pull request #16 from iclanzan/patch-2

Fixed CustomEvent