Refactor view-changing code

Also determined that key repeat code for movement is necessary