Register a router backend when registering routes.

The router-api will reject routes pointing at a non-existent backend.
This therefore creates a backend before creating routes.  This is
consistent with other places in our stack where we're registering
routes.

This PR also includes some refactoring of the existing code and tests around the persistence of the routes etc.
Because otherwise the item becomes invalid when the base_path is changed (e.g. line 26), due to the route validations that assert that the routes include the base_path.

The fact that you've asked the question suggests this at least needs a comment.  I'll add something.