Fixes to codec generator

- we do NOT use camelCase, please
- we do NOT use variable names like 'i'
Simplified use of class.has_repeats