Replaced get_class() calls with instanceof operators

This PR replaces get_class() calls with instanceof operators.

Fixes #570.
If we mark Base as abstract and then create a CryptInterface, we would catch any case where a derived class did not implement these methods, and these errors would be irrelevant anyway.