fix tests (for jdk8?), added sbt build files, small code cleanup here and there