Slater/clean search

Fixed the previous merge conflicts and cleaned up the commit history considerably.

Again, this isn't quite done, but it is in need of some code review as it hasn't really gotten any yet.

@gwprice @cpennington