Add python3 support and other misc tweaks