a kdtree written in coffeescript / javascript