pyterm: make it usable with python 2 and 3

Alternative to #1032

As a bonus I added a setup script for hustle-free installation of pyterm and fixed a little bug I found with pylint. ;-)
But it's [PEP 8](http://legacy.python.org/dev/peps/pep-0008/#maximum-line-length)! :P