Reorganize and add support for only listing files with -n