Re-arrange some imports (no functional changes).
Send email upon termination.

Install some signal handlers that send an email to TO_EMAIL when the
process is terminated, so that the user knows that wwdcc is no longer
monitoring the site.

Note that, if daemonized, the handlers must be installed *after*
daemonization, because the main thread ID doesn't survive the fork.