Pss email problems [PD-820][PD-818]

This should be done now, but it probably needs a really good check because it's easy to miss edge cases and I'm not super familiar with saved searches in the first place.

All tests pass.
I'm slightly afraid that this if will mess something up at some point and it will be impossible to debug, but there's no where else to put it really. I'm open to suggestions, though.

Also, we should really switch to using url parsing soon rather than creating the url ourselves.