Ported to Gradle and included initial set of tests