Clean up CMakeFiles

Now source files, examples and tests are automatically added
instead of manually specified in the CMakesLists.