Organize and sort the .gitignore entries.
Fix up a number of .gitignore entries.

Most of these were caused by c41b090.
Switch to using an iterator to avoid raw types / unchecked conversion warnings.
Upgrade libraries:
 - httpclient from 4.2.5 to 4.3.3
 - httpcore from 4.2.4 to 4.3.2

Both changes will be used in a later commit to add CT log retrieve
functionality to the Java client.