Basic ai setup

The basic AI engine should be functional now. Branch is finished.