Added some code to figure out which host is the the localhost for cron job reporting.  Removed some debug code and tidied.