Add support to collapse and expand a diff

This is especially useful in the history view for large commits with
long changes in many files so that only the changes that are of interest
are shown.