Utility function for getting a named property from an object. If the named property is a function invoke it with the object as context and return the result, otherwise return the property.