Gradle, idea, java 6

I really didn't change that much. Mostly just:
- reformat source
- spelling
- line width
- enhanced foreach