updating code following review.

Changes:
* utility functions are now methods
* use pip's logging rather than writing to stdout
* fixed a docstring copied from `pip freeze`
* removed unnecessary line continuations