Began to rewrite the AI.

NEEDS A LOT OF WORK.