Some ugly mocking for testing
Minor refactoring for syslog module (configurable loghost, logport; injectable 'socket'