convert attachment to a struct
try to clean up
allow inlining of attachments
Merge pull request #6 from zimmski/master

Inlining of attachments