[DO NOT MERGE] Fix file attachment bugs

https://www.pivotaltracker.com/story/show/65015464

Trying to create an attachment without actually selecting a file causes
an exception. This fixes that, as well as does some re-organisation of
the attachments code, making Attachment fully abstract and moving
non-shared code to the appropriate sub-class.

There was also another bug that meant that the carrierwave file cache
was not being preserved if there were validation errors on attachment
submission.

Note: This should not be merged until the data migration in #1243 has been run on production.