Added saving of console session history; cleanup