[ Serialize ] IORef and Exception instead of StateT and ExceptT.
Revert "[ Serialize ] IORef and Exception instead of StateT and ExceptT."

This refactoring gave no performance gains on library-test, and it
slightly complicates the implementation.  Rolling back.

This reverts commit f4530caf7684d4b2448cc28425632c6ca537a82d.