Implementation of /similarity REST endpoint

It's best to avoid getting all item IDs as this allocates a huge amount of memory. It's done in the other method since the collection has to be handed to Jersey to process, and so it can't touch the lock-pretected original data structure. And I figure /allItemIDs is rarely called.

This is like /recommend where it makes sense to iterate over the `Y` matrix. To do that you need a lock. So I pushed this down into the model in the other case. Here it can do something similar, like "topAverageCosineSimilarity" or something.