Completely rework output postprocessing to make it more flexible and added a test for duplicate test keys.