Support for Android Studio 1.0 with newer gradle and build tools

New PR from a branch that shouldn't see other changes.
This could be updated to `21.1.1` but I'll do later, updating also `compileSdkVersion` and when also the other is merged