@BenA You've probably heard this before, but two things might help:
Hydration before going to bed
Magnesium, at least 250mg daily
I got 4AM cramps as well, and started taking the suppliment every day in the morning, and it seems to help for me. I know the medical results are not conclusive, but it worked for me.
Good luck!
@BenA I used to get them in the back and the front at the same time. Usually you'd jut your heel out to stretch the back, but then the FRONT would knot and even walking on it wouldn't help.
I bought one of those massage balls and use that to rattle the knots out if they get bad. It take a few minutes, but at least I can get my foot to a right angle after a bit.