Feature/events

Clean up tests
Fix some bugs