Add Apache license file headers
Add .classpath

Since we already have .project, this is the other Eclipse specific file
that should be committed to source control.
Fix Checkstyle warnings
Remove duplicate code

This removes some duplication by moving common code to Utils.
Fix whitespace and formatting
Add Gradle build files
Enable Travis CI build