tools/smaz: genericize To_Dictionary