allow .define() to set an object descriptor for more versatility

A follow-up to my earlier suggestion.

Using an optional descriptor rather than a simple function should allow for more versatility in creating instance methods.