How to achieve accurate rotation of fingers at the point they meet the palm? I have problems with fingers in general but this is the hardest part for me. 

It looks ok at this point:



But if I rotate at the base of the finger, problems start:



This is because the rotation point should be around the middle of the knuckles, at least that's what I think:



I changed the bones to rotate from that point, but I really can't achieve a good look. Any tips? I have no idea how to make any significant improvement. That whole knuckle area that connects to the fingers rotates too, but I'm not sure how I can make it rotate and deform correctly.

Thanks
You could consider to insert in your rig a driven shape key, to ensure that you get the exact deformed mesh you desire. The shape key can be triggered only when a certain amount of rotation is reached.