Asymptotically Optimal Tests for Finite Markov Chains