grab matter attachments in JS rather than XML

(the code is cleaner that way)