Moving memmem to util.c