Moved history session into a stateful type

The stateful type is needed so that we can modify it later due to a
command line edit.  It is the backing of an incremental search operation
and hence must be modifiable
Formalize the concept of IHistorySession
Basic editing of incremental search is working

More work is left but the basic scenarios outlined in #1100 are now
working.  Lots of small changes need to be made to the implementation to
make it more robust but the infrastructure is now in place