[MECHDB] grammar tweaks and code gen/serialization fixes