Made the kd-Tree implementation more efficent

Importing takes only a fraction of the time now, and memory foot-print is reduced slightly.