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

Targets #442.

Please review.
This temporary variable can be ommitted