Add support for Mercurial

I added support for mercurial.

I wish everybody hosted their code here, but I had to remove the restriction :pensive: 

I also changed the way pwd is set, allowing to set your own for testing and whatnot.

@d2fn my go-fu is still a little rusted, let me know if you want me to change something.