Basic metaclass support

We actually had most of the base support in place; this commit just adds
the ability to specify a metaclass other than type_cls, and the ability
to determine which metaclass to use when defining a new class.

But just like how we have the base functionality to inherit from all the
builtin types but haven't updated all the functions yet, I bet there
are more places that assume the type of a class is always type_cls.