add test for EventManager, also introduce EasyMock/PowerMock library, and refactor src/ a little