What territories that were acquired by the United States helped bring about the need for compromises dealing with slavery?