refactor(events): don't clobber window.CustomEvent

Resolves #1231