WIP: adding hg support

This is not actually a pull request yet, but @ahmadia said it would be useful to show some of my work so far if folks want to comment. I'll keep working in the meantime.

Unfortunately, it's kind of hard to see what I've changed so far from the copy of GitSourceCache -> HgSourceCache. But it should be pretty obvious what's still git and what's hg.
To solve this problem, consider creating an `ensure_repo` function or similar that ensures the repository is created before this is called (if this is needed).