Initial CMake build
Minor modifications to integrate with LuaDist