Slater/clean search

The old pull request was super bogged down with comments, making a new clean one now that everything is actually hooked up and working.

@gwprice @nedbat