Added a k-d tree structure to make activeobject/point faster. moved some things around.