Switched to CMake build system

This also includes a reorganization of the soruce code to make the
growing code base more organized on the filesystem.