Py3 incompatibilities fixed.

raw_input() -> input()
print -> print()
Py3: Encode as unicode was not necessary, as strings are unicode.
Remove old debugging code. Use unittest instead.