Refactored out hg interactions
Move mercurial interactions into support file
Fixed my environment
extract out repository object
Extract out hook object
Cleanup