Emit events for open, close, put, remove, write, and compact.

This change allows apps to add trigger-like functionality around Medea.