Consolidate summary generation.
Merge pull request #398 from huwshimi/generate-changeset

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.