Moved AI Director debug code into the director itself