Restructured for building with IDEA+Gradle directly from within an app.