Add search method to the storage adapter

At the moment this is a very basic implementation of search, simply
using a regex compiled from the name.
Very basic name resolution foundations

This is currently a very naive implementation, simply using a regex to
search for the requested name. But it provides a place the search
solution we decide upon to sit.
Update search method to use new Storage interface

This removes the need to route handlers to worry about `req.fields`.
Reduce duplication in the Storage fields management

Handle filtering the hidden fields from the docs in a separate function
to reduce duplication within the storage class.
Double metaphone name search

This is a rough cut of using the double metaphone code from popit to
perform the name search/resolution. It also provides some improvements
to the doc filtering, hiding any fields that start with `_` from
appearing in docs sent to the client. It also somewhat centralises the
code that handles updating the document's `id` fields.

Still need to tidy this code up a bit and move the various functions
I've added to the storage module to a proper home and add some docs for
them.
Index all collections that have a name field
Change search url to /search/:collection

This removes any issues with documents having a slug of `_resolve` which
would have previously conflicted with the route.
Change search parameter to 'q'

This seems to be the de facto name for a search query parameter, it's
also more future proof as the search may not always simply be for a
name.
Add README section about search endpoint
Sort out storage imports

Make it easier to add/remove/change a require statement without having
to change other lines.
Move filter functions into their own module

This allows the filter module to take care of processing docs which come
out of the database, including:

- Handing swapping _id and id fields
- Hide per-document hidden fields
- Hide collection wide hidden fields
- Hide fields which start with an undercore

This means that the hidden fields middleware now simply sets a value on
the filter module, which it then uses when processing the request.
Make Filter a class rather than a module

It wasn't very clear that the exports.fields property on the module was
actually being changed by each request. By using a class that state is
clearer represented, as each storage instance has its own filter
instance, so hopefully the logic is a little easier to follow.
Add a test for API response when missing q param

Test that the API returns a 400 status code when the q parameter is
missing from search requests.
Return full results for search requests

Don't restrict fields in the search method, leave it up to the filter to
handle that.
Remove unnecessary jshint inline configuration

The camelcase option is configured for the whole project in .jshintrc,
so these declarations are superfluous.
Add a test for deduplicating slugs

This is the only part of the codebase which wasn't getting covered by
the test suite.
Refactor deduplicate slug method

Previously this method was called with a `this` value, which made the
code a little opaque. This makes it a regular function that doesn't
depend on the current value of 'this'.
Add mongoose json schema plugin
Add mongoose version of the popolo models

These models infer their schema and validations from the mongoose json
schema plugin.
Add mongoose dependency