Move event loop into the EventManager

This move paves the way for adding additional functionality to the event
loop.