Reformat build.gradle
Update dependency versions, gradle wrapper
Restructure code to fit with IntelliJ.

- Some imports have been optimized.
- Apply some of Android Lint suggestions.