Fix bug with async event handling in event router.
Add tests for event router.