* fixed order of deleting in course adn context
* adding course context to event data because it is not available alter and some stuff may depend on old context id
* adding option for context purging (keeps the context record because it might be still referenced later and it would be recreated)
* new course enrol cleanup
* removing content from some course fields that were referencing deleted content
* coding style and phpdocs improvements
* handlers can be defined as internal or external
* external handlers are not called instantly when inside DB transaction
* code cleanup
* more robust detection of broken handlers
* refixed unit tests
* removing all pending events from 1.9 - these can not be processed due to encoding changes
* finally using real 'component' in handlers table
This new messaging system replaces all the various email_to_user() calls.
They are now replaced by events triggers, and the messages are then
processed centrally according to user preferences and sent to one or more
processors (email, popup, jabber etc...)
This code is not finished yet, a lot of work still has to be done on the
interface. However, the basic structure is there and should be working.
Luis and I will be reviewing and polishing this heavily in the next few weeks.