What to do after everything we have been through?

OK, so my boyfriend and I have actually been to hell and back, we have been through so much together I'm surprised we are still together. But there's some issues that keep coming up, like a while ago when we were going through all this he ended up in a more than friendly relationship with a girl, (he never actually cheated but they way he was with her wasn't right) who I warned him about but he hid how he felt, which is understandable...but he wouldn't stop talking to her or anything after everything she had put us through! But at the time we were arguing a lot because of all the stress we were in and stuff so he wasn't happy...which I understand as I wasn't being easy to put up with. I was so hurt. And before that when we first got together he was talking to another girl who he had known for 6 years, saying he loved her and stuff, although he did cut her out of his life before I even found out so that has to say something...right? But now he's just started talking to his ex again...or more to her friend as they fell out and have no way of contacting each other so he asked her friend how she was and stuff...which to me a slightly odd...it might just be in my head but I don't know. I mean I know he loves me because he wouldn't have stuck around if he didn't but I'm really scared of getting hurt and I have no idea what to do any more.