Force functions to have C linkage

Add license header to CMakeLists.txt