Changes for attachments support

Changes updated with some doc (see also hooks and functions)