Cleanups to get the breadcrumb templating working with Python 3

Details in the commit messages.