Refactor to move alloc stuff to corealloc.c (7/7)