Rewriting to use Python

Todo: Need to update the tests and ensure that travis passes.