mostly improving search

Way too much in this pull request, mostly a variety of clean-up tasks and styling.  I had to pull one unit test because it was really really fragile (every time someone changed something on the wiki, it would have broken)