Add PreparedAttachment class

This allows us to prepare an attachment up-front
by copying it to a temp location and calculating
the SHA1 outside of the database transaction
Remove createAttachment after review