Added error handling to XHR in loadTextFileAsync, and corrected comments