jsoninfo: refactor generation of the headers