implement attribute verification using a metaclass

Attributes defined on subclasses cannot be accessed by a base class
constructor, so such a constructor cannot verify their presence. Instead
we reach out to a metaclass. It constructs the full object and only then
verifies the presence of the required attributes.