Implemented events. Closes #377.