Merkle tree implementation (in future hopefully also an Ethereum contract side, and some uses)