Switch to mock_redis for testing.

This should probably be added as a dependency somewhere?
Use redis SUNION for query.

This reduces the number of round-trips to redis when querying, and
pushes the union into redis where it is likely faster.
Simplify order_results_by_similarity.

sort_by already pre-computes the sorting keys, so there's no need to
manually perform a Schwartzian transform.
Add development dependencies and Gemfile.
Cache vectors in memory in the Redis backend.
Use Redis' mget to retrieve ids for each result.
Speed up similarity by transposing less.

Dot used to transpose it's second argument, which took much longer than
the product it's self. This changes the definition of dot and similarity
so that the second argument is a column matrix, so generally should be
transposed by the user.

sort_by_similarity now transposes the test vector, and uses that to
compare against.
Only store one ID per vector.

If one is not given, it will be automatically generated; index.add now
returns the vector ID.

This does not check for collisions between automatically generated and
user-provided IDs; it is expected that users will either use one or the
other, but it might be worth checking.

Currently, IDs for the in-memory index are generated as integers but may
be any type. IDs for Redis must be strings as they're used as keys.
Store the next available id in redis.

This prevents overwriting old vectors when reopening an LSH store.
Raise exception when an id collision occurs.
Allow turning redis caching on and off.

This also changes the name of the cache, and makes both properties
accessible.
Allow setting individual redis backend params.

Previously you either needed to specify both :resis and :data, or
neither; this commit fixes that.

Further, this takes advantage of the defaults of the underlying redis
library.
Update README for :cache_vectors parameter.

This could probably do with refactoring to make it a little clearer.
Merge pull request #2 from tomjnixon/caching

Misc. Querying Performance Improvements