Fixed incorrect index lookup when calculating IDF values. Caching of IDF values.
Fixed semantic distance bug where input sentences are corrupted.
One pass calculation of IDF values. Minor changes.