Add substitute confirm mode.

With y/n/a/q implemented. I'm not even sure I know what the rest do.

Fixes #675.