Pull search state out as class members.

Fix some comments.