Add case insensitive sorting to the menu (bug #10594).

The function is called multiple times for each element, so its
probably wise to cache the casefolded names at some point if it
turns out to be a performance issue.