Optimal Livestock Management on Sagebrush Rangeland with Ecological Thresholds, Wildfire, and Invasive Plants