Project clean-up and code refactoring; introduced gradle build script
and junit tests.