MDL-39846 implement new event dispatching and base event class
MDL-39846 sample conversion of role assignment events
MDL-39846 convert enrol_category to new events and class loader
MDL-39846 more fixing and cleanup of new events

* fix typos (thanks Rajesh)
* move log related data out from event API specification
* change callable key in definition to callback
* use event data in observers instead of cached records if possible
* event level is now a number 1…100
* improved event safety checks
* add event name and description method
* new can_view() method
* improve unit tests to test all callable types
* improved performance
MDL-39846 protect event dispatching process
MDL-39846 add logging TODOs
MDL-39846 add more magic and improve tests
MDL-39846 rename 'extra' event property to 'other'
MDL-39846 use word 'extra' for special log fields
MDL-39846 rename cached record to snapshot
MDL-39846 introduce new objecttable property
MDL-39846 implement event sink for unit testing
MDL-39846 require context when creating events

No more guessing or falling back to system context.
MDL-39846 add event property iterator
MDL-39846 improve role assignment tests
MDL-39846 fix name of property for record snapshots
MDL-39846 improve docs and fix use of deprecated classes
MDL-39846 prevent adding of snapshots after event trigger
MDL-39846 prevent use of snapshots in restored events
MDL-39846 improve validation and enable hardcoding of system context