Fixed the unit tests.

Fixed two broken unit tests. Extracted an interface for the EngineEvents
class.