Preserve window.location.pathname when replacing hash

Also consolidated related logic in functions for better locality.
Use ActiveStore to sync .active Link state

Also refactored Router to more clearly delineate between Routers
and routes.

Fixes #27