Seperate routing into its own module

Fix for issue #2