Keeping IK controller in place
The simplest solution would be the following:


Step 1:
First your foot bone has to be set parent to the leg, not the ik bone. 
Then deselect "inherit rotation" in the bone settings of the foot bone. This way the foot will allways stick to the leg, but will not rotate with the leg.


Step 2: After that, go to the bone constraints panel and add a "child of" constraint. select the ik controler as target, only select rotation and hit "set inverse". this way the bone will copy the rotation of the ik controler.