#13 Refactored event repository and added tests.