Override hashCode and toString when equals is overridden

Following Joshua Bloch's advice to override hashCode when equals is overridden.
I also accessed some fields directly instead of the getter if the getter was trivial.
Probably should override toString in more classes to aid debugging but it's a start.

Change-Id: I48240324f3c9522c275b0b2377127c051862fa7c