Format code, minor cleanup, add .settings/ to .gitignore

 * I've used the “Eclipse” built-in formatter in Eclipse and re-joined a couple lines it had split.
 * I've moved the javadocs to be above the thing they're documenting
 * Also added an `Log.isLoggable()` around `Log.d()` as we're doing string concatenations there