py: Implement base class lookup, issubclass, isinstance.