Move string hash function into String class.

hashCode() seems to do sampling while creating the hash.
hashCode64() will not.

Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be