dynalogind: generalise socket access code
dynalogind: Add TLS support.  Accept config filename on command line.