Clean up: Convert loops to 'foreach'; add generics; use StringBuilder rather than StringBuffer; remove paranoid '!= null' checks.

Fix remaining checkstyle exceptions.

Fix bug: SqlCompleter was skipping every other column.