Small declarative library for handling events