Added CMake and refactored sample
Added CMake