Implement most of destructors. Fix memory leaks and possible corruptions

- Remove redundant CmdLoggerThread