Monadic constraint solver: extension, refactoring, small fixes.