Port admin reports search/sorting function from core

* Sortable admin/reports pages
* Searchable admin/reports pages
* Fix a bug in election controller that broke search queries.