I moved set_module_from_name out of patterns (and renamed, this is Card.find_set_model_module).  Now the set_const lookup expects the module to be in modules_by_set now, so for extensions that are not loaded by filenames as in the type_transitions test, you have to do Card::Set.register_set.  A bit ugly, but not that bad.