Improved character movement logic.

A kepress array is now used to track the last key pressed so that we can make the character move in that direction only.
Merge branch 'ivan'
The array which tracks keypress order is now private.
Merge branch 'master' into andy