Wrapper function for mg_get_header()

HI Thomas,

The pull request includes changes which you have suggested, plus, a small wrapper function for mg_get_header()