Routing performance

- When matching routes from an app or core, only load the routes we need
- Cache generated urls for routes to prevent having to load the routes for them

Combined this means that in a lot of cases we only need to load a small subset of the the routes which can lead to significant performance improvements depending on the route.

For loading a preview of a file it saved ~130ms on my local test instance.

cc @karlitschek @DeepDiver1975 @PVince81