Accept asset POSTs as multipart form data

Accept POSTs as multipart form data to allow creating Asset model
instances with an associated stored file in a single request.

Addresses #595
Merge branch 'develop' into 595-file_upload_reimplementation
Merge branch 'develop' into 595-file_upload_reimplementation
Model.sync using multipart/form-data

Adds ``FileUploadModel``, a subclass of ``Backbone.Model`` that can send
the model attributes to the server as multipart form data instead of JSON.
This allows for uploading files in a single POST. This is handled by
overriding ``Model.sync``.  Currently, this only supports browsers that
implement the ``FormData`` and ``FileReader`` interfaces.  Next up is
adding support for other browsers by sending the form data via a hidden
IFRAME.  Once that's done, we can remove the ``FileUploadMixin`` view
mixin.

Make the ``Asset`` model extend ``FileUploadModel`` to gain this
functionality.

Update ``SectionEditView`` and ``SectionAssetEditView`` to take a ``language``
option.

Update ``SectionAssetEditView.processForm`` and
 ``SectionAssetEditView.saveModel`` to use the enhanced ``Asset`` model
implementation.

Clean up the code a bit to remove ``console.debug`` calls and to use ``view``
instead of ``that`` when returning a view.

Addresses #595
IFRAME-based file uploads in Model.sync

Add an implementation of Model.sync that can upload files using
a hidden IFRAME. This provides support for syncing models with file
uploads in browsers like Internet Explorer <10 that don't support
``FileReader`` or ``FormData``.

This relies on the jQuery Iframe Transport plugin.  I like this
method because we can conditionally load the plugin only when
file API support isn't present. Similarly, we just have to update
a few options before delegating to ``Backbone.sync``.

Addresses #595
Merge branch 'develop' into 595-file_upload_reimplementation
Return filename for image field

Return the filename of the image form field instead of ``undefined``
when the File API is not available.  This lets us differentiate between
the case where no value has been specified for the field and when the
File API isn't supported.

Addresses #595
Support IFRAME syncs in Internet Explorer

Update ``MultipartFileUploadModelResource`` so passing an ``iframe``
querystring argument causes the response to be wrapped in a ``textarea``
field and the content-type set to ``text/html`` to use the jQuery Iframe
Transport's trick for detecting the response data type.

Addresses #595
Merge branch 'develop' into 595-file_upload_reimplementation
Remove FileUploadMixin

The ``FileUploadMixin`` view mixin is no longer needed now that
files can be uploaded via the multipart form data sync implemented
in ``FileUploadModel``. This commit updates the data set creation
view and the featured asset upload view to rely on the new sync
implementation.

On the backend DataSetResource had to be updated to be able to
accept the multipart file upload.

Found and fixed a bug with how the form was being reinitialized in
``FeaturedAssetAddView``. The old form is now removed and replaced
by a new one.

Now that ``AssetResource`` and ``DataSetResource`` can accept file
uploads, there's no need for the separate upload endpoints.

Addresses #595
Remove unused imports
Validate fields in AssetResource and DataSetResource

Make sure that image files submitted when creating a new asset
are of a file format supported by PIL.

Also make sure that some asset content field (image, url or body) is
provided when creating an asset.

These errors still need to be handled on the client side.

Addresses #595, #606
Handle asset creation errors on the client side

When AssetResource returns an error, flash the error to the user and
update SectionAssetEditView appropriately.

Addresses #595, #606
Factor out wrapping response text in textarea

The jQuery Iframe Transport can't access the status code or content type
of the request targeted to the iframe. It provides a mechanism to fake
this by wrapping the response body in a textarea element with various
properties set as data attributes on the element.

I use this to wrap the JSON output and broke out the code that generates
the textarea output into a separate method anticipating using this in
other cases, such as wrapping error responses.

Addresses #595