Moved existing code to a solver package.