Added class trainer

fixes #154