Added support for Foo::$onEvent methods [closes #2]