What was the relationship between the collapse of the second party system of whigs and democrats and the republican victory in the election of 1860?