Initial Python 3 Support
Use correct import, move to top
Complete (?) version compatibility