RNN-G: begin making GrammarTrainer into a class