Fixed odd ply problem and random move selector

Previously only an odd max ply value worked. That is now fixed (line 57 of AIEngine).

Fixed the problem where the first encoutered move would be selected if many moves have the same score. Instead of the first, a random one is selected.
Minor cleanup of AIEngine