Add generator tool (ported from cargomedia/cm-tools)