Restructured tests, added a bunch of unit tests for events and metrics