Allow multiple route registration

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