Clean up some of the oldest and ugliest C code in the entire project...