Improvements to the AI. Pawn heuristics are not done yet.\r\n TODO: Move to Web workers.