Fix some tests
Refactor add/remove/dispatch events