Prevent duplicate docs in cart and filter search accordingly

In a future version, we'll probably want to have docs that have already
been added to the cart show up in the search results, but styled such
that it's obvious what's going on.

As for now, this will make it impossible to screw an order up.

(The pull request also includes random minor fixes that shouldn't be critical)