Fetch support.

This supersedes #203.

It looks mostly ready so I'm open to suggestions. It misses tests (again :-S) and documentation.
I don't see anywhere that specifies this will return 1. We should probably compare `!= 0` instead.