Add trainer object and unit test