Migrated to Gradle build system and some minor changes