CMake

Use cmake to generate the Makefile.

Tested with:
* Ubuntu 13.04, cmake 2.8.10.1, gcc 4.7.3.
* CentOS 6.5, cmake 2.8.8, gcc 4.8.2 using [Red Hat developer toolset](https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/2/html/User_Guide/sect-Red_Hat_Developer_Toolset-Install.html) and `devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-libstdc++-devel`.
* OSX 10.9.4, cmake 3.0.0, Apple LLVM version 5.1 (clang-503.0.40).