(TODO: It would be nicer if the associated data typesStT and StM were
associated type synonyms instead. This would simplify a lot of code and could
make some definitions more efficient because there'll be no need to wrap the
monadic state in a data type. Unfortunately GHC has a bug which prevents this:
http://hackage.haskell.org/trac/ghc/ticket/5595. I will switch to associated
type synonyms when that bug is fixed.)

The difference with lift is that before lifting the m computation
liftWith captures the state of t. It then provides the m
computation with a Run function that allows running t n computations in
n (for all n) on the captured state.

The difference with liftBase is that before lifting the base computation
liftBaseWith captures the state of m. It then provides the base
computation with a RunInBase function that allows running m
computations in the base monad on the captured state.