Add CustomEvent polyfill for events

JS CustomEvents need a polyfill to work properly in IE:
https://developer.mozilla.org/en/docs/Web/API/CustomEvent

This commit includes a polyfill