Added base/utils.c and associated tests.