Consolidate summary generation

Instead of looping through the changes a number of times to generate the summary this branch merges the functions into one.

QA: There are no visual changes in this branch, the summaries should be generated as before.
What do you think about using a switch statement here instead of these conditionals? Up to you, I don't feel strongly about it.