Sort files of in a directory based on filetype.