Move val eval functions to core.c