Python version update

Hey, 

This implements all the new Java version functionality for the Python version + adds the tests seen in the Scala version.