added functions for Kd Event generation...
see chapter four in
Parallel SAH k-D Tree Construction - Choi
changed kdtree build to O(n log(n)) algorithm