Implement `==` on `Type::Value` and `Attribute`

This was a small self contained piece of the refactoring that I am
working on, which required these objects to be comparable.
Merge pull request #16517 from sgrif/sg-comparable-attributes

Implement `==` on `Type::Value` and `Attribute`