attachments support

With tests, and in one commit :)