Fix Bug 913687: Add listing page filtering code.

All of the backend parts are too trivial to test. And we don't have JavaScript testing, but I at least tried to write the JS to be a bit testable if we ever do.