I had these same issues or similar to yours. I take a magnesium supplement, however not the tablet form. It's called Natural Calm and it is a magnesium supplement powder that you mix with water. I prefer the raspberry-lemon flavor. You can order it at drugstore.com. It isn't really a laxative, but it does have a laxative quality to it, and I no longer have the belly issues that I did prior to using it. I also have gastroparesis, which is stomach paralysis, that prevents me from eating many foods. Now that I have been drinking this each day, I can even eat fruits etc more than I did before. I also used to have to rely on milk of magnesia etc, I don't anymore.
I hope you feel better.