Finished refactoring NimLearningAI.cs.