Abstracted over the choice of solver monad, so we can experiment with performance.
Added a delay on variable instantiation, faster now.