Fetch support.

This supersedes #203.

It looks mostly ready so I'm open to suggestions. It misses tests (again :-S) and documentation.
Why isn't this getting called automatically? If we're having issues, we should diagnose them instead of try to work around them.