Decomposing Theory of Mind: How Emotional Processing Mediates ToM Abilities in LLMs