Updating header documentation for the function hash.
Computing hashes based on the samples available.

Proper computation is done now for each kind of hash except for non-leaf locations of HierarchyHash. Left a todo for it.
Computing special case hashes more appropriately.

Also updating the tests.