moved emitMethodDeclaration in cppgen
refactored class-specific code into generate_class() in cppgen