support ota restore of auto consumption data

and some other misc stuff. commit by commit should be readable

most of the work is in https://github.com/dimagi/casexml/pull/155