refac code to a more sane layout
refactor app into pages and use pushState for routing