Refs #21228 Add test for ping_remaining_envelopes. Fix bugs.

Note that the envelopes in the redis hash value are now based on
envelope full path without the protocol://domain/
Production and staging (and devel if any) will log to the same redis
however they will use different databases.
This is configured from buildout.
Porduction is on db 2
Staging is on db 1
and devel, if any is unconfiggured and will go to db 0 as default

Due to redis python bindings library, one cannot change the database from python
 - a redis handler will be bound to the database it has been constructed with.
(this is a good thing)