Gradle-ize and Maven-ize

+ fix minor codestyle issues