Python implementation of a quadtree