Dispose classifiers correctly

Now `Dispose()` is called on Classifier when document is closed.