Add command for checking whether an object has a type by comparing typenames

Targets #441

Please review. The function names may not be appropriate, thought.