Improved code style, wrote some tests and created pom.xml