Refactored build directories. Converted version 2 to Gradle.