Add callback logic for optimizer history
Created by: J3FALL
In GPOptimizer for history optimization on_callback logic should be implemented. For instance, OptimizerCallback can be a class with function on_new_iteration() that do_something after the next iteration has finished.
Additionally, is is useful to refactor history logic: instead of storing real chains (instances of Chain) in history, one could use ChainTemplates.