Handle dd and other random ways one can change buffers without insert mode. Thanks to mhi^ for showing us how.
Cleaner and more efficient. Check modified for all events.