Add itypeof method and tests