Re-factor the fetch process so that a specific API is invoked which can be called otherwise if needed, and accepts a structure of callbacks for the different fetch responses (e.g., failed, redirect, parse document).
This will allow the core of the fetch-loop to be used in contexts where the current API is not well-suited (for example, in an Anansi processing module).