Refactor tests: Add a assertValidResponse helper.

Checks that the response contais valid JSON, that it has the correct
Content-Type headers, etc. Returns the decoded json, used by all other
helpers, so all assertXXX methods now return the decoded json.
Swap IDs in responses for hrefs.

An href is the only thing the client cares about, after all, and shouldn't
need to worry about IDs at all.

Removed some ID-specific tests and delinted some as well.
Add some uncommentable lines to help with test debugging.
Search for more content synchronously if we get 0 results locally.

This makes sure we never return empty responses (at least as long as
the results exist _somewhere_), but still keeps responses speedy when
we have content locally.