MDL-45758 tool_monitor: Modifiy manager classes to return instances

Original issue - MDL-46132
MDL-45758 tool_monitor: Add a adhock task to send notifications

Original issue - MDL-46132
MDL-45758 tool_monitor: Add a universal event observer

This observer does the following task:-
1) It monitors all events and stores relevant data in a temporary table
2) It doesn't write the events straight away, it buffers them, so there is only one db write per request
3) It calculates and sees if there are subscriptions related to those events who need to be notified
4) If there are such cases, it schedules a adhoc task for the same

Original issue - MDL-46132
MDL-45758 tool_monitor: Add unit tests for the universal observer

Original issue - MDL-46132
MDL-45758 tool_monitor: Add observers to handle user and module deletion

Original issue - MDL-47376
MDL-45758 tool_monitor: Add tests for the observers

Original issue - MDL-47376
MDL-45758 tool_monitor: Behat tests for rule management

Original issue - MDL-47148
MDL-45758 tool_monitor: Add behat tests to subscription management

Original issue - MDL-47148