2) Reworked error handling in SORT and its callers. 3) Replaced DLS+SortMem with the generic TempSpace class. 4) Replaced GDS temp file management with the TempFile class. 5) Various cleanup.