function _vecOptionalSet (vec, index, val) {
    if (val != null && vec[index] !== val) {
        vec[index] = val;
        return true;
    } else return false;
}
Private method which sets a value within an array
and report if the value has changed.

@method

@param {Array} vec The array to set the value in
@param {Number} index The index at which to set the value
@param {Any} val If the val is undefined or null, or if the value
                 is the same as what is already there, then nothing
                 is set.

@return {Boolean} returns true if anything changed