Revert "Merge pull request #2950 from dimagi/refactor"

This reverts commit 6038175e6b91718226f2301d26c5377d58e9c773, reversing
changes made to a7415ca5c8f39e506baba1cc13db1ed8b56934e9.

(the build fail introduced by the prior PR was real)

https://github.com/dimagi/commcare-hq/pull/2950#issuecomment-38475110