Add CMake build to Travis config.

Build both the autotools and cmake project using Travis. (CMake will run valgrind on all tests)

Found out that the valgrind checks doesn't work properly in CMake when doing this, so see #160 for those changes as well.