Take the gas cap off, hit the tickle button under the idle screw about 10 times real quick, and see if it fires up and keeps running without the cap on. If so the cap is defective. Rarely does this happen, but it does happen. I really need to look back through all your symptoms. If you get the chance to write down what has happened and has been checked or changed since it was last running well in order and how you checked then it will help. Things like "I figure the electrical is ok" doesn't work. It has to be "I checked for spark and it was good". Sometimes you can even have spark when testing but after a short ride the CDI stops working right and starts running like crap and dies. Things can be tricky.