Is there any relationship between menstruation and either gassiness or diarrhea?

Yes. The hormonal changes associated with the menstrual cycle have been associted with changes in bowel habits and are a common cause of irritable bowel type symptoms.
Prostaglandins. In addition chemicals called prostaglandins are released with your period. Meds like Ibuprofen are used to block them. These prostaglandins may also cause diarrhea.