Added events and unit tests.