Fix watchlist hook query in the client

In fixing this, a new hook handler is added and more tests.

The problem was that core was changed to add quotes around
the RC type values, and then wikibase was not matching the
where condition in a consistent way.

Here, we use makeList() which adds quotes, and compare the
where conditions, to modify the rc_type condition to include
Wikibase "external" changes if watchlist is to show them.
We exclude external rc_type if watchlist is to hide them.

Further improvement in future patches could change
the code to make more use of FormOptions and share code
with recent changes options handling. (see bug 62798)

Bug: 62149
Change-Id: I672bedc673736d36a29161cfe116b5df021ff5b8