Fix Monad instance for MagicListT
Add MonadIO instance for MagicListT and QueryStateT