Small event system for JavaScript