Remove redundant data fetching and parsing.

Since we're not yet using headers anyway.
Use "fetch" for IO retrieval operations.
Move common utils into local Pervasives module.
Modularize logical components.