Change the syntax of FOREACH macros to be less dumb.
Automatically attach modules to events
Refactor duplicate test code into a run_test subroutine.