AI Code First Pass

AI code implemented. There are a couple tests it doesn't pass that I've
been trying to fix but having some difficulty, so I decided to at least
get something up here. I didn't put comments on all the AI functions,
but I will soon enough!