Added torch.isTypeOf after discussion with Koray

Added torch.isTypeOf to query the type of an object, including correctly following the class hierarchy. Implemented torch.isTensor in terms of isTypeOf.