First draft of consumption cache rework
WIP Refactoring
Finish consumption rework
Move code to make casexml tests happy
Merge branch 'master' into consumption-fix-again

Conflicts:
	submodules/casexml-src
Check if domain exists before getting settings
Update casexml
Merge pull request #2942 from dimagi/consumption-fix-again

Consumption fix again