Attachments now go through the Persister

Checkpoint.

Also, moved a bunch of SQL-specific code to the SpacePersister.