Added tests for events to test/events.js