Refactoring the character controller.

Refactoring the character controller pt2.

Refactoring the character controller pt3.

Refactoring the character controller pt4.