Refactors a bit to be more testable. Add tests.
Add README.md file
Add license file