Initial commit, copied verison 0.2 from mercurial repo