I know I sound like an ass but I'd try to create a header file or two(Keeps it nice and neat in my opinion). But VERY interesting....
You have a very good code process(VERY neat). I'm not very good at C but I can understand it with the C++ I know. May have to see if I can convert it later.