Support HG
various cleanup and fixes
rename module