Implement phase support in AIContext

Phases are now handled internally by the AI engine, freeing the
individual boss AIs of that responsibility.