Add checkmate and stalemate detection. Reactivate castling and promotion