Explicitly sort lists when rendering

This means it doesn’t matter what order we keep the actual data in.

Does anyone know a better way of doing this? Assigning to a variable was the only way I could get the sorting to work, but I’d rather avoid it if possible.