JavaScript: EventTarget.addEventListener shim