Python3 fixes

A number of fixes to make tests compatible with python3:

* bugfix: explicitly encode strings to UTF-8 before hashing them (python3)
* bugfix: put print statement into parenthesis (python3)
* bugfix: explicitly decode byte-string responses from json requests via UTF-8 to string