Externalized logging function cry() as mg_cry()
Added mg_get_var2() to parse repeated query strings