Expose generateEnum/StringMap
Fix enum string map when values have wholes/gaps

Also fixes trailing , which causes warnings in some compilers