Add tests for AI.py; add some methods to AI.
Changed AI.py