Sorry you are faced with this challenging situation. Those boys are lucky to have a strong mama like you looking out for them.
From my own experience with highly contentious divorce situations, I find the best thing for me to do is to postpone taking action or decision making until I have calmed down. I try not to let my emotions cloud my judgment. [I am no saint; I fail a lot--but my goal is to be as rational and logical as I can with my decision-making].
Depending on where you live, challenging for custody could be extremely difficult. [My lawyer once stated that it's not illegal to be an a jerk... only she didn't use the word jerk]. However, I agree it's worth looking into so you are making informed decisions knowing what's possible and what needs to be done. Either way, get a notebook or journal to record events like what you described. You will likely need documentation of things like this to make a case. And in fact there are many reasons to keep records of significant goings on... I'm sure you could get a list of things by googling for it.
However, I think you are saying your first priority is your children's safety. I can think of three things that may be useful in your situation. First of all, consider addressing this issue with the other parent. From the divorce and shared parenting classes I have taken one concept they are big on is not putting the children in the middle of your conflict. I would keep it business-like and to the point (maybe in an email if verbal arguments are likely to happen). Maybe speaking about the need for each parent to be mindful of actions in front of the children. Or even finding a coparenting handout to give him. Now, I know that may not be a useful suggestion given the bi-polar aspect of this. However, it might be worthwhile to get the information across if only for the sake of the children.
The other two things that will help are finding a good counselor who can help your boys process the anger, grief and confusion they might be feeling. My son goes to a counselor, although only for checking in every now and then. I like to think that she is another resource for him in case there is something he isn't comfortable talking with me about. And this could be someone who also teaches them good coping skills for difficult situations. If you don't have the money for it try checking with the school counselor or other local divorce related classes or groups.
Other than that make sure your boys know your phone number, and what to do in case of an emergency (discuss what an emergency would be, and make sure they know how to dial 9-1-1) .
Ok. Good luck. I hope my late night rambling helps somewhat.