Most sorting problems are fixed. Dead code has been removed. 3 test failures
remain but will be fixed by the new function API once it gets implemented. (CVS 1425)
(check-in: 3b55095e user: drh tags: trunk)