ContextTree: Optimizing AI Conversations for Education