Added logging functionality out to console and file using threaded logging.
Converted self log functions to logging module.
Added stop and start logging to the cli.
Changed socket behaviour from close to shutdown to allow python to handle socket clean up.