Modifications for getting Mercurial support.

Starting with getting Mercurial support, I have to commit now because my
laptop might be getting wiped. So at this stage it is incomplete.