Changes to add Python 3 support. See README.