What group governed Spanish and Portuguese colonies in Latin America prior to the revolutions of the 1800s?