Refactor routes into separate package, add integration tests.