Fixed debugging routines and added more output. Optimized the kd-tree building to decrease (5x) the number of triangle intersections