Modified check for existence of hg binary to also work on windows

I think this is a pull request for removing windows incompatibility from the hg module and state - not terribly familiar with git/github so hope I have done the right thing.