Breaks router functionality in to route library.

This will let the materializer do route functions. To get data for
reducing.