View(): Take document; do more cursor stuff.

No behavior change since the cursor stuff isn't visible yet (see "event
loop" comment).