Python3 support with enhanced tests