I can only ask that you not beat yourself up so badly. It seems that both of you had faults and bad behaviors, it doesn't help you learn to love yourself if you constantly remind yourself of how badly you behaved.
Cut yourself some slack. As far as your ex, just treat him as you'd like to be treated, and leave it at that, for now.