codegen: refactor str-split in terms of codegen_dotimes