Rename & refactor cubic solver

Renamed CalcRoots to CalcCubicRoots, refactored common code into FindCubicRoot.
Created function SortRoots to extract code that has been copy-pasted in various files into 1 place. Will add references to SortRoots in future commits.