Factor out routing table to a separate class.

Factor out routing table to a separate class. This enables us to try different routing strategies.