Fix of severe build issue and other minor improvements
- Fixed a bug that prevented the library from being included as a conan package in other projects.
- Moved some of the code from externally facing header files to internal header files. This reduces the number of includes.
- Other minor CMake and code fixes.