function defineMethod(obj, name, fn) {
  Object.defineProperty(obj, name, {
    configurable: true,
    enumerable: false,
    value: fn,
    writable: true
  });
}
Helper function for creating a method on a prototype.

@param {Object} obj
@param {String} name
@param {Function} fn
@private