Backport some changes from develop-frontend to develop

There are some bits of code (mostly around routers, but elsewhere as well) that have been changed in develop-frontend but not develop. We should backport these changes to develop to avoid merge conflicts.