Reimplement how we handle events

Separate ui- and event listener creation, fix onRemove not actually removing listeners and some cleanups. Should fix the problem in Issue #50.