Create an event object to allow reuse of event publishing logic.
First attempt at adding AngularJS tests.