Added clearEvents method + tests.