Simplify hashCode implementations, Part 1

(for example, if an object has a non-null unique name field, us this field's hashCode()).