Add duplicate attachment file renamer/replacer

Uses the existing AttachmentData#replaced_by mechanism to ensure we
can still continue to serve requests for the old filenames.
Add duplicate attachment filename finder

We can use this to generate a report detailing the attachments that
currently have duplicate filenames and also in the data migration that
will fix the duplicates
Fix Attachment.files scope to deal with STI fail

STI does not work very well with nested attributes because the type
column is protected by ActiveRecord (in 3.2 at least). And because
attachments (at least currently) on policy advisory groups and
corporate information pages are managed using nested attributes, we
can't prevent base Attachments from existing in the database. Once we
have got rid of the nested attributes, we can make the base Attachment
class abstract and prevent instances being created in future.