Back on November 27th I also posted to this discussion that I was having the same problem as everyone else regarding spontaneous shutdowns of my iPhone 5 when it reached about 20% battery life. A couple days ago, when the phone shut down at 20% for the umteenth time I decided to do what had been suggested by someone in this discussion: do a Restore on the phone. I wanted to report back that this seems to have actually solved the problem! Not only does my phone not shut down at 20%, but the battery life seems greatly improved.
I started by doing a back-up of my iPhone to my computer, not to iCloud, and then immediately doing a Restore. In my case, the whole process took about 2 hours.
There were two other things that were happening with my battery that made me believe that this was a software or driver problem, and not necessarily the battery. I use a uNu battery case when I'm going to be away from a power source all day, and when I engaged the battery case to charge the phone, the phone's indicator would instantly jump 20-30% in capacity. That proved to me that there was still plenty of power in the phone but that it wasn't being reported properly by iOS. The second was that certain applications seemed to drain the battery very quickly, but there was no rhyme or reason as to why this would be true. With the Restore, both of these behaviors have disappeared.
I wouldn't go so far as to say this will work for everyone, only that it did for me and my iPhone 5. It is certainly worth a try before having to swap out the battery.