modifications to make various parts of soil more reusable/extendable

probably easiest read commit-by-commit, mostly moving stuff around.

https://github.com/dimagi/commcare-hq/pull/2766 shows how this is useful