Key handling for arrows, movement tests, cleanup