By TravisCarden: Refactored module with an emphasis on API design and test coverage.