Removed some legacy

Now it can compile again. I also changed the CMakeLists file adding an
option for building the samples or not.