JavaScript library for custom events