Started to debug AI

I've got a feeling as soon as I've ironed out these compiler errors,
everything is going to break horribly.