JavaScript routing for non-SPA applications