Some gradle tuning.

o Change gradle plugin from 0.8 to 0.12
o Set sdk versions in root build.gradle
o Fix compile error when using Java 7
o Update .gitignore.