Port the face detection library to C++

Move towards real-time face detection by porting the library over
to C++. Fix a couple of bugs related to incorrect optimizations.