Restructure the way in which merkle trees are constructed, and add some preliminary unit tests for MerkleNode.
Add documentation.