move all C code into src/