COSMIT refactor document frequency implementations

this emplys the `csc_matrix.indptr.diff()` trick in `TfIdfTransformer`, and gives it a name for clarity.