MDL-40604 deprecatedlib: Sort out old ~2.0 deprecations

Make sure things are throwing debugging notices and are documented.
MDL-40604 upgrade.txt: change style to be more readable

As suggested by Tim Hunt.
MDL-40468 libraries: deprecated get_related_contexts_string()
MDL-40468 libraries: removed usages of get_related_contexts_string() in the gradebook

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