Mercurial Support (rebased)

This is an update after a painful rebase of the feature on the master of 3.0.0.beta :)