Support multiple elements per file.

Not my best string handling code, but it works.
maybe rename as _generateClassHeader? I'm happy to do this when I merge it