Ported SolveDiophantine and removed last dependences on PolyLib.