For decades, farmers hungry for land and families needing firewood whittled away at Uganda's forests, home to endangered gorillas, elephants and chimpanzees.