Upgrade to Java7 and remove redundancy from gradle scripts.