Fix build.

Add source sets to Gradle, rename duplicate Main classes, remove JAR
files, and ignore build directory.