Allow multiple route registration

Fixes #580. See #579, #581.

This ensures that routes can be registered correctly, and also adds tests to ensure they do.