Only include known parameters in pagination metadata

Rather than including all parameters in the pagination metadata we just
include the `per_page` and `page` properties. This prevents problems
with jQuery's JSONP functionality where the 'callback' parameter was
being added to the url twice.
Remove unused dependency regexp-quote
Reorder package.json dependencies alphabetically

This is what happens when you do 'npm install module --save', so it
makes sense to do this in a separate commit so future commits don't have
so much noise in them.
Upgrade express to v3.17.5

This is the latest version in the 3.x series and contains deprecation
warnings that should be helpful when upgrading to the 4.x series.
Update dev dependencies
Remove assert dependency

Node already provides this module in core, so it's unnecessary to have
this as a dependency as it's just a mirror of what node provides.
Move glob module into devDependencies

The glob module is only used within the test suite, so there's no need
for it to be in the main dependencies section.
Use app.delete instead of app.del

This fixes a deprecation warning in the latest version of express.
upgrade npm on travis to avoid dependency detection issues

see https://github.com/npm/npm/issues/4984 for details. Without this the
ncp dependency of fs-extra fails to install.
image upload api endpoint

Allows images to be uploaded over the API and saves them to the local
filesystem. Some faff with dates and formats in order to work round
issues with mongoose and elasticsearch not going the right thing.

Fixes #214
attach extra properties to the image

e.g. source or notes
add image put endpoint to replace images over the API

PUT /:collection/:id/image/:image_id replaces the image with image_id.

Factors out the code common to the PUT and POST requests into functions
to reduce duplication.
API endpoint to delete individual images

DEL /:collection/:id/image/:image_id will remove that image and delete
the file on the server. This only works for images stored on the server
as remote images don't have IDs
delete all images API endpoint

DELETE /:collection/:id/image will remove all images associated with a
document and remove any image files on the server too