Split debug flags into DEBUG_PCALLS and DEBUG_API; fix more quotation style and import naming.