Convert to Gradle build
Formatting and a bit of clean up