Split Patch and TreeChanges generation

Remove Patch from TreeChanges
Make repo.Diff.Compare() generic
Introduce EncodingMarshaler.Cleanup()
Make string marshaling either lax or strict