temporarily move functions to class methods instead of instance methods

- this allows the objects to be pickled