First changes for Python 3

These were relatively quick and straightforward to make.
There is much more to be needed, and likely important revisions to make regarding the split between `str` and `bytes` (absent in older Python versions).