Add cmake infrastructure instead of old Makefiles

Allows to build in a multiplatform way, and package cleanly.