add (but not yet use) Cursor::notify framework

an inversion of control makes expressing the logic of "do foo when
anything happens besides bar" much cleaner than what we currently do,
which for each thing except bar, say "do foo"

we have quite a few of these foo/bars, so the next few commits will be
converting them one by one

if you wanted to make it out like a deep insight, you might call
this "the observer pattern"
use notify to clear up/down cache when cursor does...

...anything besides move up/down
use notify to stop selecting when cursor does...

...anything besides select
use notify to clear selection and show cursor whenever...

...the cursor moves.

had to move the .notify() call in Cursor::moveDir because we want to
test this.selection *before* clearing the selection
use notify to delete selection whenever cursor edits

also move notify call in Cursor::deleteDir to after checking
this.selection
make Cursor::escapeDir chainable
make Cursor::notify chainable

and hence prettify lots of code #cosmetic
Merge branch 'refactor.cursor-notify' into dev