A small polyfill and reference for JavaScript custom events