Implement all non-kernel gpu functions in GPUDevice and replace corresponding calls.

Get rid of now empty util/math_functions.cpp.