Test code for Latent Semantic Indexing.
Slightly optimized tf-idf.