function extend(target, opts, callback) {
  var next;

  if (typeof opts === 'undefined') {
    opts = target;
  }

  for (next in opts) {
    if (Object.prototype.hasOwnProperty.call(opts, next)) {
      target[next] = opts[next];
    }
  }

  if (callback) {
    callback();
  }

  return target;
}
Extend utility function for extending objects.
@function
@param {object} target - Target object to extend.
@param {object} opts - Options to extend.
@param {function} callback - Callback function after completion.
@returns {object} Extended target object.