Added serialization. CMake fixes. Working.