Refactoring GrammarBuilder to allow incremental changes to grammar