refactored out js and routing to remove duplication
Merge pull request #1 from urthbound/refactor

refactored out js and routing to remove duplication