Misc changes to support python3.
Fix travis configuration for python3 builds.