DOM EventEmitter ported from Rye.js