function getArg(aArgs, aName, aDefaultValue) {
    if (aName in aArgs) {
      return aArgs[aName];
    } else if (arguments.length === 3) {
      return aDefaultValue;
    } else {
      throw new Error('"' + aName + '" is a required argument.');
    }
  }
This is a helper function for getting values from parameter/options
objects.

@param args The object we are extracting values from
@param name The name of the property we are getting.
@param defaultValue An optional value to return if the property is missing
from the object. If this is not specified and the property is missing, an
error will be thrown.