finished 1st pass refactor of main codepath
finished 1st pass refactor of main codepath

dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android,dimagi/commcare-android