Ted's Rework FnCallFold to use VarRefValueToJson and sorting helpers

With a few adjustments.