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

Targets #442.

Please review.
`has_meth` would indeed be a more intuitive command to use.