Explicitly set filetypes in sort_tests
Add copy_substr() function to utils/str

Copies characters from the string terminated by the terminator.
Add empty lines to utils/str.h

To improve readability.
Optimize file name comparison on sorting

This is achieved by omitting string copying or evaluating length of
strings in some cases (when we know they are files or when we don't need
to modify them).

Also add some comments and fix arguments style.
Move sort.c:compare_file_names() after its uses
Small optimization for file_is_visible
Merge branch 'optimize-filelist-loading-a-bit'

Optimize file name comparison on sorting and adding slash in
is_file_visible() function.