Change to Gradle from Maven

Also update libraries, fix deprecations and changes.
Fix Android tests - remove JUnit 4