basic adoption, needs more work

Parts need to be rewritten for Mercurial