Make sure the BP Attachments API behaves the right way when WordPress < 4.0
Before WordPress 4.0, there was no dynamic filter based on the name of the action posted in the upload form. So we also need to filter wp_handle_upload_prefilter to make sure the BP_Attachments->validate_upload() function will actually validate the uploads for versions of WordPress < 4.0.
Improve the i18n of the avatar type error, as the avatar types can now be filtered in the BP_Attachment_Avatar class.
Add unit tests for the BP Attachement class.
Fixes #6278