Deprecate isValidClass

Fixes #2374 

Tries to make the minimal change but adding a new function that isn't used internally.