Refactor for easier testing, and add regression tests
Correct JSON outputter to produce nicer JSON (no trailing space, final new line)
Strip out “[blah blah]” (which was probaly original intent of regex, just not formatted correctly). See https://github.com/mysociety/pombola/issues/953
Tidy up whitespace in names and stript trailing space. See https://github.com/mysociety/pombola/issues/1025