Event dispatching and listening library