Added .travis.yml and modified CMake scripts

This PR adds a Travis script that should be more robust. See also #132.