Refactored to make it more of a Python package.