Refactor Project#add_file/add_dir to DRY