MDL-40464 libraries: Deprecate get_user_courses_bycap()
MDL-40465 libraries: Deprecate fetch_context_capabilities()
MDL-40467 Libraries: deprecated get_role_context_caps()
MDL-40463 libraries: Deprecate get_courseid_from_context()
MDL-40468 libraries: deprecated get_related_contexts_string()
MDL-40468 libraries: remove usages of get_related_contexts_string() in the gradebook

Also tidied up the functions by removing unused parameters.
MDL-40468 libraries: remove usages of get_related_contexts_string() in groups
MDL-40468 libraries: remove usages of get_related_contexts_string() in the data library
MDL-40468 libraries: remove usages of get_related_contexts_string() in reports
MDL-40468 libraries: remove usages of get_related_contexts_string() in the user pages