function extend (target, source) {
if (source && typeof source === 'object') {
  var keys = Object.keys(source);
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];

    // Don't copy "protected" properties, since they have special meaning/behavior
    // and are set by the onoFactory function
    if (protectedProperties.indexOf(key) >= 0) {
      continue;
    }

    try {
      target[key] = source[key];
    }
    catch (e) {
      // This property is read-only, so it can't be copied
    }
  }
}
}
Extends the target object with the properties of the source object.

@param {object}  target - The object to extend
@param {?source} source - The object whose properties are copied