JavaScript library for event programming