Added the possibility to pass a function as event handler  in the “events” object. Tests updated
README.md updated