Complete preliminary implementation of tree diff.