which country gained independence from spain in 1816?