Change TypeM to use ErrorT monad transformer.

This is a preparation to add more monad transformers later.