Improve efficiency of HashDict contract

When contracting in size the HashDict does not need to relocate
(re-hash) key-value pairs. It is not required because each of the
deepest nodes in a trie become a bucket on contraction. This bucket
contains all the key-value pairs in that node.
Merge pull request #1240 from fishcakez/hashdict-contract

Improve efficiency of HashDict contract