Add dispatchEvent polyfill in element-events.js

Found here https://gist.github.com/jonathantneal/3748027