Refactored quadtree indexing. Moved quadtree test from examples to tests.