Automatic translation import

Change-Id: I51b3ccc5991bc17742b560514d8ef0af510c88dc
Automatic translation import

Change-Id: I0bb83d2d5980af8b5ec722a56af65f3732286028
Add Apache license file headers
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