What two world events encouraged Latin American colonies to seek independence?