First version of the model trainer (plus dev)