#1418: Implemented persistence of grammars. Currently it does not work, because the Tuple type is not serializable (see #1442).