Refactors init improving speed and consistency.
Log system has been modified too.
Defines deafult log granularity depending on build type
Minor fixes in code and cmake.
Fixes cmake missing code path.
Fixes not free memory.
Fixes incorrect log message