Enable metaclass functions to chain.

Use type=type as a fourth parameter to allow multiple inheritance
through function definitions, rather than requiring then to inherit
from type to support complex inheritance.