merkle: Make MerkleNode.collect return a set of nodes instead of a dict
Previously the MerkleNode.collect method was returning a dict whose keys
are node types and values dict of {<node_hash>: <node_data>}.
In order to give more flexibility to client code for the processing of
collected nodes, prefer to simply return a set of MerkleNode.
As a consequence, MerkleNode objects need to be hashable by Python so
the hash method has also been implemented.
Closes T4633