Extracted the operation
Added a history class to deal with the history of a script

And tests