Added new mechanism for checking if an object implements an interface.
swapped interface-oriented style for duck typing