Added the .cpp file for the current code.

This is the initial untested code, it currently builds, but still needs
testing. It will eventually become a library.