Added utilities to prevent memory leaks in event propagation. Closes #139.