Refactoring, adding tests, switching to Maven build, adding command line interface