minor rewrite for Python 3 support. Some other fixes in corresponding files.
Merge branch 'master' of https://github.com/eill/pyst2