Converted StateBasedSolver to use State Monad Transformer

This simplified existing implementations as well as being a learning
experience for using monad transformers.