Allow caller to customize sorting.

This also eliminates sorting by string length by default. That's only really a
good idea when we're talking about Codex results.
Sort dot files after non-dot files.