Split Patch and TreeChanges generation

Remove Patch from TreeChanges
Make repo.Diff.Compare() generic