Sort JSON for consistent ordering of lines.