JS routing. Fixes #12

Very rudimentary JS routing using a switch statement against `window.location.pathname`. This fixes the js error being thrown on all pages other than the homepage as reported in issue #12