I would agree with most about the rpm's dropping however, since you stated it almost died on you I would be looking elsewhere.
Just general info, if an engine just quits no warning no nada - 9x's out of 10 it's electrical. If it stutters, drops in power however you want to describe it, it's...