Make history class

This adds the SampleHistory Class to entities.py.
The history generation is slightly faster than the previous version, but not by much (~10%).

Another PR will come for the scilifelab repo to use this object rather than the methods from lims_utils.py.
That´s Maya's part, actually. The point is to switch the content of out_artifact in the while, so at some point, this gets False. The only way for this to go into a permanent loop would be having an artifact A being input and output of the same process. I don't know if that is possible or not, but this sounds highly unprobable. 

My approach only uses alternate_history. The two others methods are legacy methods that I only cleaned up so they could be understood. I would like to keep them to be able to switch back to them, should my approach fail at some point.