split up event handlers and listeners, added simple listener that wraps a closure, added dispatcher