fix default sorting function to ignore case. Add option to provide a custion sorting function.  The custom sorting function must accept a "term" and return a sort function accepting a and b list items.