Pagination for filtered lists (and a filter fix)

Filters were giving inconsistent results because of unexpected "stateful" behavior of Javascript regexp when using the 'g' (global) option.