Ditch regex matches in the router

Replaces these with normal segment length checks. This is possible with
all-string keys because the handlers already check the keys using a dict
lookup, so we can save some time by just relying on that rather than
doing regex checks while trying to dispatch a URL to its handler.