Greatly improved get_file_folder_by_slug

Moved the method to be a helper function and added an optional parent to
stop confusion between same slug categories, brand and products.