Simple generic quadtree implementation