See my blog post with more information about the problem and links to other related articles and solutions.
See the git log for a more detailed walkthrough. I always try to keep the code in compilable and green state - commits with the same number would be normally a single commit, but I wanted to show what were my steps exactly.