Convert the build system to cmake

This easily allows us to build OSX targets in addition to Linux. I
haven't done any work to support Windows.