Add query for whether an object is an instance of a type

Targets #283.
I guess you missed that `ws_object` does inherit from itself, and you fogot to check it here. So this would (as it currently is) be an endless loop.