In what ways did the Civil War transform the nation?