PHP 5.3 crashes if `method_exists()` is called on a class that does not exist.

Use `class_exists()` to test for class before testing for a method within a
class. Props @gibrown