Metaclass implementation and test