Port to c++

Port existing code to C++11. Development in C is discontinued.