Implementing history saving, refactoring of command_base interface