Add sorting to template output for stability.

The test data was already sorted, so jiggled it a little to ensure that
sorting really happens.