MDL-8018 testing and bugfixing of curl emulation library + added download_file_content() into filelib.php