Improved library logging code + moved some code that is only needed by CLI front-end from "Shared" project to "CLI" project.