Added Applicative and Functor instances for State monad