dir_list() implemented, fixed a few minor bugs

Still to implement file_list_emptydirs()