About a third of Drupal\Core\Template\Attribute is just for CSS Class handling. This code should be moved to it's own handler class.
The new AttributeCssClass will descend from AttributeArray and that class will be refactored to use \ArrayObject as its base on this ticket. The new AttributeValueInterface will be used to associate these classes with the attribute system since it isn't possible for AttributeArray to descend from \ArrayObject and \AttributeValueBase at the same time.