Implement command history

Typing up-arrow after invoking the readline with Alt-x now displays
a completion list of previous commands.