Renamed kccSettings to kcc_settings. camelCase in C feels like bad form to me.
Added back basic data race checking for threads.
Minor refactoring.