Welcome to health care magic.
1.Your history and symptoms suggest most possible cause of the symptoms - irritable bowel syndrome
with features of gastritis
2.The testicular pain
could be due to infection / inflammation which is causing the above symptoms - if its on going issue, an ultrasound
examination will help to evaluate exact cause of the pain and discomfort.
3.The digestive issues you are facing can be treated with diet control.
4.You should first avoid junk,spicy,excess fat contain food, alcohol. Take more of salads, fruits and fibrous diet for better bowel moment.
5.At the same time multiple portions in regular intervals of time - this will help to normalise the bowel habits and gastric issues.
Hope i have answered your query,
any thing to ask ? do not hesitate to ask.