[CLI] move history related variables into history_t structure in order to allow better abstraction