Convert build system to CMake for cross platform compile, and update README. Fix some compile nits.