Limit tag queries by namespace_id to improve API performance.

This is a quick way to resolve the most egregious slowness when doing API
queries filtered by a tag. We should however explore doing this more
automatically, e.g. with the association proxy.