Made AI multithreaded, so a call to its constructor does not block the
calling thread.