Generalizing the config functions in utility-functions

By requiring that config be passed as a param to each function. This
avoids presuming that the variable $config exists in all cases.