Convert algorithm history to be saved in task metadata.
The nested dictionary representing the algorithm history.
The reformatted history in a TaskMetadata object
convertHistoryToMetadata()