Added mostly working C++ implementation.
Check note.txt for details.
We will still need to write this in Haskell, since most of us probably already used a "main" language.