Export enhancements

replaces https://github.com/dimagi/couchexport/pull/66