Fixed Gradle builds

Tests now run again. No more dependencies on JDK1.5 so maybe there will
be fewer project errors now.