reorganize files; move to CMake