Allow more endpoints to use commentable_ids param

The commentable_ids param is a comma-delimited list of ids indicating
that only threads belonging to one of the specified commentables should
be returned. It can now be used by any endpoint that delegates to
handle_threads_query (most importantly "#{APIPREFIX}/threads"), and
the commentable_id field is now indexed for efficient filtering.