Moved token parsing functions out of libcurl.