Updating gradle to support AndroidStudio 0.5.0

Importing changes made by chris2toasters to support Android-Studio-0.5+