New $filters encoding which avoids collisions
Use '~' as the filter separator, as it shouldn't get URL encoded, and is
less likely to appear in a filter than '-' (which we were using).
If '~' does appear in a filter, double it. And make sure that the first
item after the filters can't be empty and can't start with '~' or an
alpha-numeric, so that the encoding is unambiguous (we only accept
filter terms that start with an alpha-numeric).
We internally build the old value that $filters would have returned, and
also check CGI parameter xFILTERS against that, so that on upgrades old
format serialised filters are handled correctly.