Add Gradle files.

Not yet 100% finished, but already has the most things.
Add missing license headers in the source code.
IntelliJ doesn't do new lines at the end of Gradle files..
Add travis badge