Added router.routed event and relevant test.
Tweaking code.