Refactoring to better support URL navigation

This includes significant changes to make the location hash function
sort of like a database from Backbone's perspective.