Does not sound like CDI problems.
Give it a good dose of Seafoam in the tank. Better yet remove carb, soak in Seafoam and clean it out good. Many small orifices that easily replug up if any dirt is left in the carb or gas.
After being stored for some time mine ran poorly like yours for awhile. I Seafoamed it as above. Still had some problems. Next day or so going about 50mph it got into a spell of serious coughing then a big backfire and it has run perfect ever since.