extern c issue and wrong imports

Related to a5ed27a0ba5b5a3a0f8e25a5bbeb4fb3e8ac221b 

this addresses the extern c issue and handles  --imports correctly rather than mashing them into a single string.