How did Mexico try to bring stability to their country? What were the problems they faced from Spain, France and the United States?