Reimplement command-prompt history

Also add shift-left/right for back/forward one word