Cleanup/code refactoring

I've taken a look at some issues that [Sonarqube](http://www.sonarqube.org) spat out, in combination with some things pointed out by [Google Code Pro](marketplace.eclipse.org/content/codepro-analytix). Unfortunately the autoformat feature of Eclipse caused the formatting of the code to also be fixed (to your standards created by `gradle eclipse`) at the same time, sometimes hiding the changes in large git diffs.

The individual commits outline the issues I have fixed. Most are relatively minor issues, but can result in small performance gains or simply make the code adhere to more software engineering principles. Some of these changes include:
 - Implementing both `hashCode` and `equals`, rather than just one of them.
 - `hashCode`/`equals` should be present when a `compareTo` is present as sorted maps/sets can sometimes use both.
 - Log the exceptions that are thrown. After all exceptions should indicate Exceptional circumstances that should warrant logging.
 - `instanceof` for class-type checking as subclasses should also be correct. If they are not then the Liskov Substitution principle is violated and then you've really opened another can of worms ;)
 - Usage of interfaces to hide the concrete implemenations used by classes, e.g. return a `List<String>` rather than an `ArrayList<String>`. I have not refactored all of these, as I am not sure how the xml annotations you use would respond to this change in fields.