Update CMakeLists.txt to build a library and an executable.
Refactores the project organization to externalize a header for the library API