Add ChessMinMaxAI and ChessMinMaxAITest. Fix several bugs.