Adds an event listener polyfill and refactors the client event class.