Code to rename/replace duplicate attachment files

Uses the existing AttachmentData#replaced_by mechanism to ensure we
can still continue to serve requests for the old filenames.
Code to find duplicate attachments on edition

We can use this to generate a report detailing the attachments that
currently have duplicate filenames.