function getActorTable(actorIds, change) {
  if (actorIds.indexOf(change.actorIds[0]) < 0) {
    if (change.seq !== 1) {
      throw new RangeError(`Seq ${change.seq} is the first change for actor ${change.actorIds[0]}`)
    }
    // Use concat, not push, so that the original array is not mutated
    actorIds = actorIds.concat([change.actorIds[0]])
  }
  const actorTable = [] // translate from change's actor index to doc's actor index
  for (let actorId of change.actorIds) {
    const index = actorIds.indexOf(actorId)
    if (index < 0) {
      throw new RangeError(`actorId ${actorId} is not known to document`)
    }
    actorTable.push(index)
  }
  return {actorIds, actorTable}
}
Takes a decoded change header, including an array of actorIds. Returns an object of the form
`{actorIds, actorTable}`, where `actorIds` is an updated array of actorIds appearing in the
document (including the new change's actorId). `actorTable` is an array of integers where
`actorTable[i]` contains the document's actor index for the actor that has index `i` in the
change (`i == 0` is the author of the change).