Add checkmate and stalemate detection