Infrastructure for subcommand completion

Basically, we need to match the longest possible command signature
instead of just looking at the first split argument.
Simplify readline setup

Now that we've caged up readline, all we need is to enable completion.
Trigger completion display on all completions

readline's display match hook is only called if you can actually provide
completion info for it, so use that to rotate the input completions and
use the initial completion query to bring up the window.

Still needs to be dismissed automatically.
Enter should also accept current completion