Allow passing in a callback before writing output

This allows for (optionally) modifying the unit tests (e.g. modifying or
normalizing the suite or test names) before writing the output file.