Shallow clone support.

This is still very much a WIP.