Move main Octree search method into Octree::SearchState

The actual code is mostly the same, but having it as a method of
Octree::SearchState is a bit cleaner.