Adding missing header.
Major cleanup of build infrastructure

This commit cleans up the build infrastructure by porting existing build
mechanisms to cmake. This also fixes compiler warnings in varintgb.h and
the incorrect namespace used in horizontalbitbacking.cpp.