Added support for python2 objects with unicode __repr__ functions passed to template