The long spaghetti looking thing was most likely an Ascaris roundworm - the females can get up to 12 inches long while the males are about 10 inches long.
Corn kernal looking things could be Tapeworm segments. The Tapeworm is made up of segments with each segement having its own set of male and female parts. They mate and the segment will fill with eggs - when it is full - the segment will break away from the "mother" tapeworm.
These segments (depending on which species of Tapeworms is being hosted) can look like corn kernals, rice grains, seeds and peanuts.
Hookworms cause anemia and can cause mucous. I hope this help in your investigation.