refactor to make more testable and add tests
add license info
setup.py