Added a training options class. Refactored all the code that makes the training functions into batch trainer