ChangesListSpecialPage: Implement buildMainQueryConds()

This also involved adding some default options to getDefaultOptions()
and a new method getDB().

Change-Id: I7389a72bfcf176480bfc36f9d6efc467e1a5e76a
Merge "ChangesListSpecialPage: Implement buildMainQueryConds()"