MDL-41726 mod_quiz: Replace handlers with  observers for group events

This also implements a filtering of the events to be handled when
a course reset has been started.