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:
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 incldue 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 - mod fixes (7)

The assign and glossary modules both refer to groupmembersonly, but
only in the unit tests. I have modified the unit tests to use the
new API instead.
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: Add SQL feature for user lists (9)

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 usage in workshop (10)

The behaviour of workshop is now defined as follows:

* grouping (when group mode is used) - restricts the list of groups that
  are shown, and the list of users who can contribute.
  [Previously, the grouping had no effect unless groupmembersonly was
  enabled, which is inconsistent with other parts of Moodle.]

* availability restrictions that apply to user lists (group, grouping,
  profile) - these also restrict the list of users.
Workshop fixup
Upgrade.txt updates
Fix to modinfolib changes
Quiz fixup
Assign changes
Assign fixup