MDL-38147 Added function coursecat::get_children() to retrieve subcategories

Caching results, sorting categories, retrieve only those that are displayed. Added tests
- MDL-38147 more tests
MDL-38147 added function coursecat::search_courses
added function course_get_coursecontacts() temp ???
- MDL-38147 / MDL-37009 courses in category, back end, unfinished
- MDL-38147 caches purging
- MDL-38147 course_search returns instances of course_in_list now