I told myself not to do this but I spent all night getting help from a friend on how to fix moonwalking. (The white squares are testing the arrow keys and are just there for visual debuging). But the gist of it was that I wanted the first direction you press to become the "facing" of the sprite until you let go of the original direction. Since you move in 8 directions but face in 4 there were exceptions made for when you move diagonally. It's confusing stuff but I'm just glad to get it working and fool proof.
What it used to be: