Simple URI routing and generation in Javascript