Refactor a tad to allow direct control of our dispatching.

There's probably a better way of doing this, but after this commit, IO::Prompter works again for the first time in … years?