formula spec validation WIP

 - 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
 - add tests for active spec selection