ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templates