Add routing: current level preserved in URL

This contains some duplication and redundancy, to be cleaned up later.