Just adding some details on how the cat manages to turn its body while preserving its angular momentum.
Rotating different parts of his body at different times in the right direction isn't the reason why the cat manages to preserve its angular momentum. The reason for so is that there is no external torque acting on the cat! So, no matter what the cat does, as long as he doesn't touch anything (let us consider the fall to be such that the air resistance is negligible here), his angular momentum will be constant.
What the cat really does is use this angular momentum conservation law. Cats are able to turn their "upper" and "lower" body in opposite directions with no difficulty at all (they are very flexible). To understand how it all happens, let's see what a cat does while falling upside down.
First, the cat notices he is upside down, and he does so with his eyes or with the gyroscope in his ears. Then, he will divide his body (front and back) into two separate rotation axes that are tilted from one another. While falling down, he starts turning his front legs to the ground (it doesn't matter which direction he chooses to do so) and the back legs will turn in the opposite direction due to the conservation of momentum angular. Problem is, if he does so, he might end up with his body twisted and this could be a problem! So, to avoid this, when turning to the front, he will extend his back legs while tucking in his front legs. By doing so, he increases the moment of inertia of the back and decreases that of the front. This causes the front to spin faster than the back! When the front is aligned with the ground, he extends his front legs to increase the angular momentum and stop the rotation. Finally, he twists the back legs along the rotation axis, returning them to the original position and bracing for impact (all legs extended)!
You can watch the awesome video listed as a source for a really good explanation along with a real cat falling in slow motion!