Library which implements a directed graph of event-driven elements