Add tests, remove unused code
Add tests, documentation