Haxe implementation of quadtree