Attachments support 

Attachments support (issue #15) and many minor fixes