Speed-up GetHashCode()

Some minor fixes to cache un-changing (but expensive to lookup!) values.
Since GetHashCode() is quicker to use than Equals when it is in a hot path
these changes have quite a significant impact.