Remove last use of deprecated Formula#recursive_deps

Fixes #19107.
Move formula equality tests out of test_bucket
Make test formulae initializers more flexible
link: eliminate naked rescue
wip: first pass at fixing validation

 - remove direct ivar accesses
 - remove set_instance_variable
 - remove validate_variable
 - introduce set_spec, validate_attributes, and determine_active_spec
 - add tests for attribute validation