Add history functionality to cmdline