Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What Matters