Full code review

Let's use the notation from the LDA paper. M here instead of D for the number of documents. Please do the same for the rest of the file.