Add support for Gradle build, fix up Maven build