Redesign search API.

Instead of messing with a bunch of formatting in the querystring,
search will expect a json body with the search parameters.  Besides
removing all the encoding horrors, this also largely decouples the
formatting from the logic, particularly w.r.t. nested boolean queries-
the nesting is unambiguous.