Functor and Applicative instances for StateT