Added new send_email function which does all of the email sending stuff.
Added new after_cleanup_script, which is called after the cleanup
threads have finished.
Added --force switch to avoid checking the lock file.
Fixed cleanup problem.