Revert "Ported to C all but math and model"

This reverts commit 7ec16b226a9679aa561f8db4233578ad4c73121f.
New math lib + geometry pool; doc fixes and debug macro in build