Finished refactoring python bindings.