First draft of a kdtree class