updates remote link attachments to work via ajax

and other minor cleanup fixes