Finishing initial CPU AI (fixes #4).