refactored CascadeClassifier to hide implementation details (take 2)

this is updated, more conservative version of #1918