Added move validation to the controller. Fixed history advancing.