MDL-47509 Profile restriction: More oracle/text fixes

1) Get rid of "uid" that is a reserved word.
2) Add cross-db support for text columns in the get_condition_sql() method
   by adding a new, defaulting to false for BC param and intensively using
   the sql_compare_text() helper to build the correct sql fragments.
Merge branch 'wip-MDL-47299-master' of git://github.com/marinaglancy/moodle
Merge branch 'MDL-47301-master' of git://github.com/FMCorz/moodle
Merge branch 'wip_MDL-47303_m28_jquery' of https://github.com/skodak/moodle
MDL-46658 gradebook: Fix gradebook behat tests

This issue is a part of the MDL-25544 Epic.
Merge branch 'wip_MDL-47477_m28_jqueryuitheme' of https://github.com/skodak/moodle
Merge branch 'MDL-28484-master' of https://github.com/lucisgit/moodle
MDL-28484 Libraries: Update comments to suggest using new is_https()
MDL-40697 core: added grade_deleted event
MDL-40697 core_grades: changed user_graded event name
MDL-40697 core_grades: removed existing user_graded event triggers
MDL-40697 core_grades: trigger the user_graded event
MDL-40697 core_grades: trigger the grade_deleted event
MDL-40697 core: added more unit tests for the user_graded event
MDL-40697 core: added unit test for grade_deleted event
MDL-40697 mod_*: fixed unit tests so they pass
MDL-47572 libraries: modify unittest to avoid random timing fail

Thanks to Nigel Cunningham
MDL-38106 lesson: fix tests introduced in MDL-32870
MDL-38540 Lesson: import images in question answers
MDL-46481 backup: Reposition one-click backup button