Fetch support.

This supersedes #203.

It looks mostly ready so I'm open to suggestions. It misses tests (again :-S) and documentation.
Can we include the name and URL in this error message, so it's more helpful if it gets included in an application's logs?