make the event callbacks and definitions more readable

Initially tried to use std::function, but that used 4k more memory than Module*.
So this patch is simply a readability issue and makes no fundamental change to the code.

Leaving the history in as using std::function as a callback mechanism is cleaner and this shows how to do it. But the lost memory is not worth the cleanliness.