Restructure loop
Use lengthCompareJsonbStringValue where possible.

This clarifies the role of length-based sorting, and lexical sorting.