Refactored pypi module into a package. Got all the unit tests passing again, fixing or removing brittle test cases.