cpp: fixes around model namespace includes and visitor generation