Add support for File attachments

Implemented by @seanpdoyle and @djcp while pairing, this adds support
for file attachments. Files should be persisted to the filesystem to
avoid problems related to threading.