Update to gradle 1.8 and tweak build script for new AS