Cleaned up and prepared for merge.

Cleaned up code and commented recent changes involving movement and
cursor.