Refactor export code
Use SQLite as the intermediate format for Shapefile exports.
Expose SQLite exports, since we’re already creating them.
Use a dedicated initial query to get metadata, rather than using an
intermediate/on-disk stage.
Allow export mode to be set through the export options.
Use promises to avoid a race condition
Merge pull request #11 from LocalData/refactor

Refactor export code