core, parser: moved ser_mem[r]mem() functions from parser to ut.c