SolverImpl refactoring. Improve the logic with which various corner cases like constant program, failures to evaluate initial and final cost etc are handled. Change-Id: Id43d45ebe46b65918909d47201d6fb7b89ebbd57