PM-742 fix for the datareuse cascading bug. nodes are now only removed
after all the candidate nodes have been marked for deletion.
PM-742 unit tests for data reuse.