Character, direction and rotate

I have the direction calculations working correctly now (after a long struggle!), except that as the slope increases the speed increases and I need to fix that. Also, I don't have comments or unit tests for the new functions yet. So, you probably shouldn't merge this in yet, but I wanted to show you what I have done so far.