add instance checking stuff

A few utilities for checking what an object's type is, if it has instances, and if its members have instances (/of particular types)