Refactor route setup slightly and add very basic tests