MDL-44070 Conditional availability enhancements (1): availability fields

Adds a new field 'availability' to the course_modules and
course_sections tables. This will be used to store JSON format
data about a tree of availability restrictions.

Includes changes to modinfolib so that the new fields are available,
to the editing forms so that they can be entered and modified, and
to backup and restore to include the fields there. There are unit
tests for the back-end (modinfolib and backup/restore).

As the user interface will be implemented in a future commit, there
are no Behat tests yet.
MDL-44070 Conditional availability enhancements (2): subsystem/plugin

This commit defines the new /availability root folder, with
/availability/classes, /availability/tests, and
/availability/condition where the condition plugins will live.
Condition plugin prefix is availability_, e.g. availability_date.

Rationale for this organisation:

1. I was originally going to put this in /lib/availability but
   it has been pointed out that putting even more junk in lib
   is probably bad.
2. 'availability' and 'condition' are the two names used in code
   to refer to this system ($CFG->enableavailability).
3. The prefix has to be short enough to allow database tables
   (although in practice I assume that condition plugins will not
   normally contain database tables).
MDL-44070 Conditional availability enhancements (3): API/tests

Implements the new availability/plugin API. This represents a
Boolean tree structure that controls the availability of an
item.

In this commit, the new API is not yet connected to the rest of
Moodle, so it doesn't do anything yet.
MDL-44070 Conditional availability enhancements (4): date condition

Adds date condition (back-end only). Includes new component and unit
tests.

AMOS BEGIN
 MOV [requires_date,core_condition],[from,availability_date]
 MOV [requires_date_before,core_condition],[until,availability_date]
AMOS END
MDL-44070 Conditional availability enhancements (?): core access

Changes core code to use new API instead of the old one when
checking user access to activities and sections.
Grade condition (done! This commit message needs fixing)