Add cmake project. Support clang, clean up warnings.