Chess: fixed check/mate, randomized move order, minor optimizations