Add better Python 3 support
Merge branch 'master' into local