* Move and rename \core_calendar\local\api::get_legacy_events() to
calendar_get_legacy_events() in calendar/lib.php.
* Fix the parameter-normalising callback function in
calendar_get_legacy_events() so that it correctly handles false values
by returning an empty array instead of it returning a non-empty array
that contains an empty element.
This function was moved to local_api::get_legacy_events.
Also removed the calendar/classes/api.php file since it no longer contained any
functionality and added unit tests for local_api::get_legacy_events (a copy of
the unit tests for calendar_get_events).
Part of MDL-55611 epic.
The logic from get_events has now been moved in to our local API
and is used by the event vault to retrieve events, instead of
querying the database directly.
This has the advantage that it deals with overrides and only
returns events for the relevant user.
Part of MDL-55611 epic.