What was the South's economy based on before and during the Civil War?