Branch filters

Adds ability to display & filter on branch names. While doing this, fixed the query generation by reverting a previous change. See the commit message of the last change for details of what was wrong.