Move more export logic into the export module

Also split the export tests out of the normal DB tests into their own file, and
use StringIO instead of the Tempfile hack.

Part of #82
Merge pull request #84 from eapache/export-tests

Move more export logic into the export module