Ok so my 97 outback was driving fine. I drove it to work. Was on my way home and about 5 mins into the drive, it just started bucking around, the rpms going crazy and then shut itself off. I managed to get it to the gas station. I was low on gas, so I thought it was just being temperamental. Filled up the gas. Started her up. Rpms were all over the place and it would die.

Next I checked the oil level, and topped it off (It burns oil, but it wasn't "low", just below the full mark).
Checked my coolant. That was fine. Everything was ok.

So I sat there for 30 mins, trying to get her to stay running long enough to get me home.

We get home, it was bucking the whole time (a 10 min drive) and it died 3 times. The rpms would go from 200 rpm all the way up to 2500-3000, and then drop back down. It would keep doing this until it would sputter and die.

Ran my scanner on it. Popped up a few codes. One for my o2 sensors, one for my speed sensor A.

Waited a little bit, ran the scanner again and now it popped up even more codes. o2 sensors, speed sensor and now ign.

Alrighty then. We cleared the codes for shits and giggles and unplugged the battery. Let her sit for a while. Went back out, no codes. Drove just fine to work and back. Nothing.

NOW the question is....I know it will act up again at some point. Is this more a computer problem? Or are the actual sensors bad? Where should I start? I looked online. People are all over the place with this problem. Some say computer, others say sensors, and some even say plugs. Plugs are new on mine.

There are some big price differences on all of this stuff, and I just dont want to throw money I do not have at my car.....

If it is the computer (or ecu, whatever fancy term is used here), is it just a plug-n-play? Or do I have to bring it to the dealership to program?