Make case export not use so much memory

The first commit (no idea why I called it `stop`, must have been a hit-return-too-fast mistake or something) is just moving code form casexml to corehq (see: https://github.com/dimagi/casexml/pull/18). So it might be easiest to read the three non-merge commits separately.