Routing optimization - reinstate 8x speedup and fix reloading bug

Lighthouse ticket:

Fixes a bug that resulted in the routing code only being generated once.
In addition, reverts a change from trunk that turned routing back into a
linear search (from the optimized version). Includes a test and timing

The performance boost is excellent, but the bug fix was very needed; it
was giving very odd routing problems with Hobo's dynamic routes in
development mode.