Presumably you are applying for jobs in writing in which case I would just say that you are looking for a job that offers a different challenge or something equally vague.
I would avoid going into too much detail on paper because any employer is probably going to skimread and fear the worst, unfairly. In a situation where you are competing against other people for a position it is too easy to use this to put you out of the running.
Assuming you get to interview you can then explain in person in a very bright and breezy way that you had all kinds of problems unfortunately and it is a great relief to now have it all sorted thanks to the new meds.
Makes a big difference to be able to say this in person and show that things have changed for the better.
You can pre-empt the poor reference by expressing regret that things were difficult before you changed your meds and again emphasise that all that has changed now.
When faced with 50 or 60 applications for one position I have been ruthless about who got binned first. Long-term health probs is an obvious place to start looking for candidates to reject at that stage. Once they are through the door and talking to me in person it is completely different though.
So try and be brief!