Update Gradle build to support proper releases

Heavily... ahem, "inspired" by Roman Nurik's awesome DashClock project
https://code.google.com/p/dashclock/