Update: it was probably bad gas. I drove it long enough to use up half a tank, then filled it up with Mobil premium, and it drove better. Kept adding gas as I burned more, and it got better still. Thanks for all the advice.