It looks like you need some more distance between you and M ... Trying to maintain a friendship after a break-up is sometimes too stressful. You don't have to become enemies (I don't think), but less contact I guess is what I'm trying to say. Well really, probably no contact at all for the time-being. Your mind needs a break from thinking about M, it's like you said, you've just got to let her go, and focus on the positives in your life.
Sometimes, you may be taking too much upon yourself, or "trying to fix it all at once." The M situation, however, doesn't necessarily need to be fixed. Just released. If M wants to do her own fixing that's great, but let her be the one to make that decision.
I hear you about the time and emotional energy you invested in this relationship. But first of all, don't let the sense of time lost tempt you to lose more time (and emotional energy) in the future. Change your investment to be channeled into things that are rewarding. If the investment in M is resulting in mostly negatives (and I think it is), then make a change in where you direct your efforts from this moment forward.
Secondly, the time and emotional energy you invested in the relationship with M aren't necessarily wasted. Even if you never see, speak, or write to M again, you still have the experience that you gained from your work on this relationship. You learned things about yourself that will help you in future relationships. Nothing can take that away.
The thing to learn here is that you want to travel in a direction in life that will bring you happiness. If trying to maintain contact with M is just bringing you stress, anger, and despair, then it's time to let that contact go, in preference of other things you can do that will be rewarding to you. Care enough about yourself to let the unhappiness-causing things go. Forgive M enough to let her go and live her own life.
If you read through your own posts on this thread (especially the last couple of posts), you'll probably see hints about what kinds of things help you find happiness in life, and about what kinds of things undermine your happiness. Once you've identified those two classes of things, try to imbrace the happiness-things more, and distance yourself from the unhappiness-things. Pain is all well and good as a teaching tool, but you don't need to purposefully burden yourself with extra pain. Life supplies us with plenty of pain all by itself.
I hope your next night's sleep leaves you waking with some more of those positive thoughts. If it doesn't, you can still turn to this forum to vent, and re-center yourself.
Sending well-wishes and regards,
Love means never having to say, "Put down that meat cleaver!"