Better AI Bots

I cleaned up and rebased pull request #2600.