Javascript library for event listening and triggering