Switch to cmake

A big PR I know, but with switching to cmake we also switch to git submodules (If I'd have done that for autotools I'd would have done that twice).

I kept some of the autotools files for now, since some part is not yet coported to cmake (e.g. the keyring stuff).

(I made a new PR because travis ignored the other one)