Add !<number> as shortcuts to history

I added handling of !<number> in input line as shortcuts to history entries, similar to UNIX shells.

Probably it should be made configurable.