Cross-browser support for triggering events, creating CustomEvent, and attaching listeners (without jQuery)