More python 3 fixes

more python3 (keep unicode rather than converting to bytes)

It would be good to get a pypi package soon