Fix include/exclude options in the directory scanner

It would only work for files that had registered UTIs. Now it also respects the file extension.