In what ways was the achievement of independence for the Spanish colonies and the establishment of republicans in Latin America similar to that which occurred in the British colonies that became the United State?