organizing merkle code a bit, preparing to work on pruning