Updated Class file encoder function to C++.
Rewrote Class buffer to implement a C++ API.