Add gradle build for core jar

Add a gradle build script to create the core library jar.