Add commands for checking whether a object has an attribute/method

Targets #442.

Please review.
Yeah you are right, I should have drunken the mate first, before reviewing