Fixed most warnings.
Added CMakeLists.txt.