Update target sdk version to 20
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