Adds register_class_method, a variant of register_method where the user can specify a derived class to register the method for.