Refactored events with variants, added tests and fixed a few bugs

Trying to fix issue #79 I ended up refactoring events so that they're implemented with variants and adding tests.