Add support for objects as event listeners

The benefit is that you can pass an instance of a class and the sole requirement for the provided object is to implement the `handleEvent` method, much like the W3C DOM `EventListener` interface. The benefit here is that you can easily add and remove event listeners without preserving pointers to functions bound to a given object. The `handleEvent` method is passed the `event` as an extra first parameter.