Optimize the export_to_csv part of the map creation job.

Using offset/limit keeps the peak memory usage in check (~250mb).
Doing the division on the Python side avoids SQLAlchemy helpfully
creating Decimal objects for the return values. And moving the
writelines call out of the loop avoids many I/O calls by writing
1 million lines at once, with currently ~47 million in the end output.