Sort of starting over, in C this time, C++ gets unwieldy fast. (BROKEN)

This commit WILL NOT COMPILE, have to rewrite for C from C++.