Refactor base fetch related functions.

I refactor base fetch related functions as branch ```chaizhenhua-ipro```. the patch fails some tests, while 41f75282d87cac48bc14b87c9b54f2073195caca also fails.
```
Failing Tests:
  In-place resource optimization
  In-place resource optimization
  In-place resource optimization
  convert_meta_tags
  Check for case where rewritten cache should get purged.
  Check for case where rewritten cache should not get purged.
  Check for case where rewritten cache should not get purged.
  Check for case where rewritten cache should not get purged.
  Check for case where there is a rewritten cache hit.
  Check for case where there is a rewritten cache hit.
  Non-local access to statistics fails.
  Non-local access to statistics fails.
  Non-local access to statistics fails.
  Non-local access to statistics fails.
  keepalive with html rewriting
  keepalive with serving resources
  keepalive with beacon get requests
  keepalive with beacon post requests
  keepalive with static resources
FAIL.
With serf fetcher setup.
```