Split Patch and TreeChanges

Linked to #483.

The idea is to remove the generation of the patch from the `TreeChanges` class, and in the process to create `repo.Diff.GeneratePatch()` (naming advices welcome!) methods to fullfill the need of patch generation.

I'm not very happy with the current complexity of the diff code, and am still trying to find a better way to do it, but I thought it would be interesting to have some early feedback.