Clean up debugging code in externalib.php