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-40424 libraries: Deprecate context_instance_preload_sql()