Doesn't sound like an alternator or battery, unless it's dirty terminals. My car did something similar, I cleaned my terminals and it never did it again. Just something easy to check while under the hood.
All honesty, sound like it's your MAF. What did you clean it with? I have come to find out, cleaning the MAF's just prolong the inevitable. Tried on my car, a Sonata, and a Volvo. All three ended up getting new MAF's.