Allow specifying a minimum similarity of results.

This also implements pluggable similarity functions.

This isn't yet well tested.
Expose 'min_similarity' through REST interface.
Add 'include_data' param to allow discarding data.
Initialise similarity properly.