Added python bindings and refactored client