Added Trainer class, cleanups around TrainedSet