MDL-44725 Availability: Replace groupmembersonly - upgrade, core (1)

* Upgrades existing data so that the groupmembersonly option is
  replaced with equivalent data for the new availability API.
* Removes the database field and admin setting used for
  groupmembersonly.
* Changes core modinfo library to remove/deprecate groupmembersonly
  data and functions.
* Changes other core library files to remove groupmembersonly
  references.

Includes deprecation of several functions, listed in lib/upgrade.txt.
MDL-44725 Availability: Replace groupmembersonly - core_availability (2)

Remove groupmembersonly usage in the core_availability API, and change
the update code (used in backup) so that it considers groupmembersonly
when restoring old backups.
MDL-44725 Availability: Replace groupmembersonly - backup (3)

Change backup and restore to not include the field, and to cope
correctly with 2.6 (and before) and 2.7 backups.
MDL-44725 Availability: Replace groupmembersonly - forms (4)

Remove groupmembersonly option from module editing forms.
MDL-44725 Availability: Replace groupmembersonly - login (5)

Remove groupmembersonly option from require_login.

NOTE: This code, and another branch (both related to login when
accessing activities on the site course), are not actually
necessary because there is code above which already checks
$cm->uservisible.

NOTE: You can see this change more simply by doing
git diff --ignore-space-change; indent was altered.
MDL-44725 Availability: Replace groupmembersonly - FEATURE_xx (6)

Remove old FEATURE_GROUPMEMBERSONLY as no longer required.
MDL-44725 Availability: Replace groupmembersonly - glossary (7)

No change to actual module, only unit tests.
MDL-44725 Availability: Replace groupmembersonly - quiz overrides (8)

This only affects the quiz overrides form, as groupmembersonly was
not used elsewhere. The change simply restricts the list of users
shown when selecting somebody for overrides.

Some additional code is needed to (efficiently) load the $cm object
as a cm_info so that the availability API can be used on it.
MDL-44725 Availability: Replace groupmembersonly - assign (9)

Updated code to restrict list of users. Also includes changes to
ensure that a cm_info object is available (required for availability
checks).

There is a tweak to upgradelib to reflect the different fields used.
(Note that upgradelib is not used during upgrade, but only when
converting assignments from the old assignment module.)
MDL-44725 Availability: Add SQL feature for user lists (10)

The previous API included a facility to filter a list of users
to include only those who are allowed to access an activity, i.e.
only people who belong to the required groups etc.

This change adds a new API function to return SQL that obtains
this list of users, so that it can be combined with other
queries.
MDL-44725 Availability: Replace groupmembersonly - workshop (11)

The availability restrictions that apply to user lists (group, grouping)
now apply in workshop:

* In user lists.
* When randomly allocating users (also now works as expected if you use
  group mode and a grouping with the activity).