Change manual parsing of commands by readline.

Also, see documentation to implement our own completion at
http://web.mit.edu/gnu/doc/html/rlman_2.html#SEC36