Small event system for javascript