added grammar class
grammar is now saved to and loaded from file