MDL-38147 changed logic for building list in make_categories_list()
MDL-38147 fixes to phpdocs and avoid using deprecated context functions
MDL-38147 Added functions coursecat::search_courses(), get_courses()

Also search_courses_count(), get_courses_count();
Added unittests