Add support for cmake builds.

Although Jam may be the preferred build tool in many cases, cmake is also
a very commonly used build tool. Adding cmake support simplifies integration
of bootstrap-dht for those environments.
Fix all of the sign-compare warnings.