Create library of common hg-related functions