Syslogging

Tidied up stuff and added ability to log to syslog