WIP: add extract attachments with test.