Added includes for cmath at various points. This is a default include on Mac OS but not on any sane systems. Changed calls to std::abs to std::fabs to resolve ambigious call errors. Former-commit-id: 4d3da21bce
4d3da21bce