Add filteredquery command.
This code was rotting on my hard drive for years. Maybe it could be
extended.