Maintain correct tracker state on MIDI overwrite.

This is a little hard-edged in that edits while rolling will prematurely chop
off any playing notes, but at least the state of things actually reflects
reality.  More sophisticated solution hopefully to come...
Fix various cursor problems.

Add a new scoped cursor system that makes it much harder to screw up and end up
with stick cursors and so on.