Made debug toolbar panel work with Python 3.

A lot of WTForms-related tests fail though.