Parallelize the 3d ray tracing.

Unfortunately, this does not use libnative because it is still too buggy.