add is_typing utility

simple, liberal check for whether a keypress is probably typing or not.
setting the notebook dirty flag is now an event

set_dirty.Notebook
trigger dirty on CM change
remove unused is_typing js util
use dirty event to set autosaved/unsaved changes

instead of last-saved timestamp
Merge pull request #3371 from minrk/dirty-event

make setting the notebook dirty flag an event