Port Backbone URL handling for hash and pushState based urls.

Converts mysite.com/#/posts/123 to mysite.com/posts/123 and vice versa.