Safe to build with java 1.6 now

- Also some cleanup in the gradle scripts