Enabled global switch for cacheing data.
Corrected the way ngrams and their probabilities are counted.