Added CMake build system
Added initial init and cleanup code.