refactor repeater workflow
refactor repeater workflow

the main goal of this is to make it more testable / callable from
other contexts. just pulling stuff out into another function and
refactoring where needed/appropriate

dimagi/commcare-hq,puttarajubr/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,gmimano/commcaretest,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,gmimano/commcaretest,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq