shift stuff around for grammar versioning, and implement concrete grammar factory for v1