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.