admin: Send JSON response when action finishes

Wait for action(s) to finish and then return the result of the operation
along with the ids for which there was an error.

The returned JSON has the following structure:

{
    error_ids = [id1, id2, id3],
    result = "Message to display"
}

Last, the following HTTP status codes can be returned:

* 200: All actions have completed successfully. All other status codes
  mean that the actions have failed partially or completely.

* 400: Bad request.
* 403: Not permitted.
* 404: Unknown operation.
* 405: Method (GET) not allowed
* 500: Server error. If this status code is returned, this means that
  there is no accompanying JSON to use.
* 501: Not implemented.
Merge branch 'feature-admin-ajax-actions' into feature-admin