Complete rewrite of the router. Should be considerably faster now thanks to CTFE