clean up the way events are handled and use std::function
don't use std::function as it uses a lot more memory than Module*
just expand events.h, leave the rest the same, just a readability issue
add some comments
Merge pull request #422 from wolfmanjm/fix/module-event-arrays

make the event callbacks and definitions more readable