fix breadcrumbs

Breadcrumbs are not currently used in our ui. However we have old code for that.

This fixes several issues with that breadcrumb code. I hope the commit messages are explanatory.

Note: To see the changes of this you should add `${self.breadcrumbs()|n}` somewhere in the root template.