Pull in code from Chad
Re-apply a188c7d7 Allow C++ linking
Correct credits