optimize,util: moving parForeach and friends from optimize.TrainerHelpers to util.Threading