(Issue 466) Add config option to purge rabbitmq queues after connect but before subscribe
double image sizes
Merge branch 'master' into issue-466

Conflicts:
	node_modules/oae-util/lib/mq.js
log authentications
code review issues
quote object keys
add util method for logging authentication success
Log logins from all strategies
Set YouTube title as the content item's displayName
Fix SlideShare displayName
Pluggable Preview Processors.

This commit introduces a bunch of outstanding preview-processor related bugfixes (#456, #436, #435, #434, #431 and #409) as well as some other improvements.

This is a little bit more flexible and should allow for better third-party integration.
There are now 2 phases that happen after a `generatePreviews` task is received.

The first phase is a selection phase where the correct (or best suited) processor is selected. Each processor is handed the content item and is allowed to do async IO to check whether it can deal with this content item. Each processor returns a number that expresses the suitability match between the content item and the processor. A negative number means `don't use`. The processor that returns the highest non-negative number is selected. If all processors return a negative number, the content is ignored. The default OAE processors return a number from the interval [-1, 10].

The second phase is the actual preview generation process.

`generatePreviews` tasks now contain a `revisionId`. This means that preview images are now associated with revisions rather than content and that revisions will have thumbnails (as per #456)

 * For each revision, 2 thumbnail images get generated. The square 162x162 thumbnail and a new flat rectangle one (535x250) that can be used in an activity feed.
 * Thumbnail images in the library, search page and activity feed are served from `/api/download/signed?uri=<..>` rather than the `/api/content/:contentId/previews/thumbnail.png` endpoint. This eliminates 1 Cassandra read query *per* downloaded thumbnail (if a user has 20 thumbnails on the page, 20 cassandra requests are avoided)

Activity items no longer dump the entire previews object. The content item's thumbnail and large flat rectangle url are returned. The UI should not be constructing their own URLs to generated preview images. If that would ever happen again, it means we missed something.

This PR builds upon the collaborative documents PR and should be reviewed/merged after the collabdoc PR goes trough.
Creating previewsdirectory in initialization life cycle.
change context to principalid for internal api
Notifications use new content-revision event.
Return response for picture uploads as `text/plain` for IE9 support.
Adding quotes
Merge branch 'master' of github.com:sakaiproject/Hilary
Fixing issue caused by new version of Express / Querystring
Merge branch 'changepic' of https://github.com/bp323/Hilary into changepic
Previews refactor: getting and setting previews should pass the revisionId in the REST endpoint
Previews refactor: Using MQ.purge to purge previews.