To check your gall bladder function, you need a hydascan. To check for stones or sludge they'll need to do an ultrasound. They should do the ultrasound first because if you have stones, no further testing is needed.
From experience, fatty foods make it act up worse. Once you've gotten it flared up, it doesn't matter what you eat, everything can make you sick. Mine was "chronically inflamed" which meant that sometimes it worked fine and no matter what I ate, I was okay, and then it would act up again and everything made me sick. For temporary relief, you might try a very low fat diet. Also, I found that caffeine made mine worse--even drinking black tea, much less coffee or cokes.
I don't know about you, but I would wake up in the middle of the night sick as a dog and in so much pain I couldn't stand up straight. I couldn't lay flat on my back because I hurt worse and was more nauseated. A lot of people vomit as well, but I only did that once; all of my problem was bile diarrhea. I found that if I ate certain foods--like pizza (which is fatty, although I didn't make that connection at the time)--too late in the day, I tended to get sick at night. If you have the same problem, try eating your supper early... like at 4 or 4:30 in the afternoon, then eat low-fat snacks later that evening. That will give your guts time to get the food through before you lay down. (Of course I was in college when I was sick, so it was easier for me to eat that early, but you might want to try and make it work because it did help me some with the night attacks).
It took them 5 years before tests showed my gall bladder was bad. Mind you, me and everyone else in my family who had had a bad gall bladder knew that's what was wrong with me from the get-go. I always tell people to find a food that triggers an attack--like pizza or a 2-liter of coke--and consume it the night before their test to get it good and riled up so it will show-up. My first round of tests came back clear because I was not in the middle of a bad streak when they tested. If you have stones or sludge, they'll show up regardless, but if you have a functioning problem, like me, it may only show up when you're having a bad streak and may appear to be fine when you're not.