Optional TF-IDF ngram weighting added.

Hi!
I've added optional TF-IDF weighting for N-gram index. It's disabled by default and overhead is small. I use it in my project at work.