Refactor tesseroid kernels

Moved the rediscretization into Cython for a greater speedup. Dividing only along the required dimensions (check if distance < ratio*size for each dimension).