Deworming is definitely something that should be done before giving birth. Worms could have some serious and sometimes life threatening effects on the mom and kittens. What you are describing could be either roundworm or tapeworms and you should really have a Veterinarian do a stool examination - including a microscopic exam - to determine which worms she has and give her the appropriate medication.
Store bought dewormers do not cover many of the worms and also if there is tapeworm, they are transmitted by fleas and you may want to have mom checked out to ensure she is properly protected against fleas.
Martin Slome DVM
Centre Street Animal Hospital
7700 Bathurst Street Units, 40-42
Tel. (905) 771-9855