Javascript Router for HTML5 pushstate and degrades to Hash