Velo, I had IBS for quite a few years, was diagnosed with it after a lot of testing, and I managed to reverse the condition. For the years I suffered from it, my intestines would spasm and the pain was awful. The bowel movements would either be flat as a pancake or be diarrhea. And yes, I had the same accidents that you did, mistaking something more critical for gas.

I reversed the conditoin by 1)learned to control stress, 2)eliminated food chemicals and caffeine from the diet, 3)went totally heart healthy with the nutrition, along with the increase of fiber from fresh fruit, veggies, whole grains, legumes, etc. as already mentioned and eliminated processed foods from the diet, 4)swallowed the probiotics every day for over a year as already mentioned, and 5)put daily exercise as a priority over other things.

Because I eat so much fiber, I have to get up extra early before the morning rides to make sure I've had enough trips to the bathroom. If the starting point requires a drive, I make sure I get there early enough to avail myself of the toilet facilities if needed.