added AI, compressed previous AI format

also added checkmate/stalemate detection