Added partial Python3 compatibility.

Some tests are still failing.
Fixed in StreamOutput.do_write() to handle utf-8 strings.
Finished Python3 compatibility
Merge pull request #1 from SDisPater/python3

Python3 compatibility