try to enhance performance for at least get_courses() query

```
detached_categories = [name for name, __ in XBlock.load_tagged_classes("detached")]
category = item['location']['category']
apply_cached_metadata = category not in detached_categories and not (category == 'course' and depth == 0) 
```

Although we should probably compute detached_categories just once (put it in a class variable)