Modifies code to be python3 compatible.

Merge branch 'master-py3' of https://github.com/bcl/authprogs into bcl-master-py3