Wh notify and pinger

cleans up pinger's occasional timeout issue when sending system_alerts.

also has some cleanup of unrelated code's unused vars, refactored functions, etc.