Split up dir_list functions into its own source/object file